On Thu, 19 Oct 2000, ts wrote:

> >>>>> "H" == Hugh Sasse Staff Elec Eng <hgs / dmu.ac.uk> writes:
> 
>  Difficult to explain because I don't speak english, it's better if you
> look at eval.c and look for NODE_ITER and NODE_FOR
> 
>  NODE_ITER is used for 'each'
>  NODE_FOR implement 'for' (see the call to rb_call(..., each,...) in NODE_FOR)
> 
> H> Then 'for' simply isn't syntactic sugar for the braces or for the
> H> do...end.   It does a similar job, but does it differently.  The author
> 
>  It does a similar job, and do it the same way.
> 
> The difference is that 'each' introduce a dynamic scope, when 'for' don't 
> introduce this scope.

That's what I meant by "differently" :-)  This confirms that I understand
it better than I did.  Thank you.  Do you agree with my patch to the
manual?  If there is concensus on it being an improvement, Matz may
possibly accept it.  (This is one form of Murphy's law: "If you write
things in such a way that nobody can misunderstand, somebody will." :-))
> 
>  You have in the source of rb_yield_0
> 
>     if (block->flags & BLOCK_D_SCOPE) {
> 	/* put place holder for dynamic (in-block) local variables */
> 	ruby_dyna_vars = new_dvar(0, 0, block->d_vars);
>     }
>     else {
> 	/* FOR does not introduce new scope */
> 	ruby_dyna_vars = block->d_vars;
>     }

I have not really got into the source yet.
> 
> H> So that rule about precedence has gone in 1.6?
> 
>  Apparently, yes

OK, thanks.
> 
> Guy Decoux
> 
	Hugh
	hgs / dmu.ac.uk