On Mon, 03 May 2004 04:41:58 +0900, Mark Hubbart wrote:
>> I can see only
>> one problem: compilation of local-variables. Inside the eval block, any
>> local variables that you don't assign to will be treated as a 
>> method-call,
>> and this could be annoying, because they may exist in the binding.
> 
> I don't understand why local variables would be treated as a method
> call... They aren't treated that way when you eval a string, correct? 

Correct.

> is there something about the compiler that would treat the locals 
> differently in a block?
> 
> --Mark

I may be wrong about this, but I think this is how it would be:
Eval compiles it's expression at runtime.  At that time it
already knows which variables are locals, and which are method-calls.
However blocks are compiled at the same time as the rest of the
program, so at that moment Ruby cannot know if an identifier is
a local variable or a method inside the given binding.

Kristof