From: Brian Candler Date: 2007-06-02T00:11:23+09:00 Subject: Re: Introducing the "it" keyword On Sat, Jun 02, 2007 at 12:03:25AM +0900, Mariusz P??kala wrote: > > > return it if with:it(v+1) < 10 > > > > > > return a if with:a(v+1) < 10 > > > > > > return a,b if ( with:a(v+1) + with:b(x*y) ) < 10 > > > > But if you're going to label them anyway, then why not write > > > > return a,b if ((a = v+1) + (b = x*y)) < 10 > > The whole discussion started because this code does not work in current > ruby parser rules. OK, but maybe fixing this is an easier language change than adding "with:foo(bar)"? That is, the above could be defined to be identical to if ((a = v+1) + (b = x*y)) < 10 return a,b end I agree this would make the already somewhat "magical" rule about where local variables spring into life more difficult to understand; rather than being based on a strict left-to-right tokenisation, it would have to be based on the parse tree. That is, given expr1 if expr2 then expr2 would be treated as logically "earlier" in the source file than expr1, for the purposes of local variable creation. But that's fairly sensible, since if expr1 and/or expr2 ever get executed, expr2 *must* be executed before expr1. B.