[DGD] 1.2.30

Par Winzell zell at skotos.net
Sat Sep 8 22:44:24 CEST 2001


 >     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;
 >     }


Yes, and make it atomic. :-)


 > 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. :-)

They don't necessarily ned to be throw-away objects. I think there are
conditions where we don't need filename restrictions. For example, the
system-level auto object could actually -write- the source in a zero-
second callout after the compile: then all upgrade tools would work as
usual.

Otherwise, we could demand that the object holds its own source. But it
seems to me we run into trouble then -- because ./lib/. objects using
the kernel library can't be called, so they can't be asked about their
source -- thus we need a more complex solution there, or simply forbid
./lib/. objects from source (which does not strike me as a hardship).


 > Erwin -- dreaming of compiling a lib from files that are really
 >          strings stored in objects, minor bootstrap problem ;-)

That'd be a fun test indeed. Personally I'm going to use it to add LPC
as a compiled-on-the-fly scripting language :)  Thanks, Dworkin.

Zell
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list