From: Dan Sugalski Date: 2002-12-19T06:42:31+09:00 Subject: Re: Nature of ruby At 5:27 AM +0900 12/19/02, Nikodemus Siivola wrote: >On Thu, 19 Dec 2002, Dan Sugalski wrote: > >> Nope. A compiled Ruby program executes eval by running the embedded >> compiler and executing the compiled code. Programs can generate >> executable code internally on the fly--it's not *that* difficult... > >Eval is eval as in evaluation: a function that *evaluates* the >given string. Why on earth would you want to first compile it for a single >evaluation? In the following you would compile, sure: > >str = "proc { foo }" >f = eval str >p f # "#" >c = compile f >p c # "#" > >Or so I would think. This is all a bit too wishy washy anyway. Nah. If you're compiling, you might as well go all the way, as it's not much extra work. (The time is all in the optimizer, so that sort of code may not be as well optimized, but...) Besides, since the code being eval'd could change other existing routines there's the potential for a fair amount of upset in the current system, and just getting it all patched up at once makes things easier. (And that way you don't need to have an interpreter at all around) -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai dan@sidhe.org have teddy bears and even teddy bears get drunk