[DGD] 1.2.30

Erwin Harte harte at xs4all.nl
Sat Sep 8 20:11:21 CEST 2001


On Sat, Sep 08, 2001 at 07:06:54PM +0200, Felix Croes wrote:
> diff -c dgd/src/Changelog:1.268 dgd/src/Changelog:1.269
> *** dgd/src/Changelog:1.268     Mon Sep  3 14:54:31 2001
> --- dgd/src/Changelog   Sat Sep  8 19:04:15 2001
> ***************
> *** 1480,1482 ****
> --- 1480,1484 ----
>      lightweight objects.
>    - Upgrading a lightweight object went wrong if the number of variables was
>      increased or reduced.
> +  - Added an optional second argument to compile_object(), a string to compile
> +    the object from.

Bliss!  So a possible use of it would be something like this?

    mixed
    run_code(string str)
    {
	string result;
	object ob;

	ob = compile_object("some_silly_unique_name",
			    "mixed function() { return " + str + "; }");
	result = ob->function();
	destruct_object(ob);
	return result;
    }

I see a definite need for a wrapper around this to avoid name clashes
for throw-away objects, but that's easy enough to do. :-)

Erwin -- dreaming of compiling a lib from files that are really
         strings stored in objects, minor bootstrap problem ;-)
-- 
Erwin Harte <harte at xs4all.nl>
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list