From: Eleanor McHugh Date: 2007-06-04T23:29:43+09:00 Subject: Re: Introducing the "it" keyword On 3 Jun 2007, at 20:45, Robert Klemme wrote: > On 03.06.2007 19:34, Eleanor McHugh wrote: >> I tend to agree, although that's because I'd really like Ruby to >> have the 'with' syntactic sugar that VB has. I also much prefer >> the idea of being able to choose my own block variable name rather >> than being stuck with 'it' which to my eye is an ungainly word. It >> still bothers me though that a formulation that's intended to make >> for a simple atomic statement would now cover three lines onscreen... > > I believe Ruby does not have "with" because there is instance_eval > - it's more to type but can be easily aliased and has the same > effect - rebinding "self". (I know that some talk about another > "with", that rebinds arbitrary variable names. But I believe the > original idea of "with" was, that you could invoke methods without > explicit receiver). It's not entirely clear to me that 'instance_eval' would obey the same scoping rules as 'with' in VB by dint of introducing a block. I also just happen to prefer the syntactic form in the same way that there are people who routinely use 'for' statements in their Ruby code. Ellie Eleanor McHugh Games With Brains ---- raise ArgumentError unless @reality.responds_to? :reason