From: "David A. Black" Date: 2005-08-10T23:09:50+09:00 Subject: Re: new block notation (was: Re: ruby-dev summary 26468-26661) Hi -- On Wed, 10 Aug 2005, Austin Ziegler wrote: > On 8/9/05, Trans wrote: >> You could still use the brakets: > >> double = do(x){ x*2 } > >> That would mean 'do' == '-> '. >> >> But if you ask me, it's all gotten pretty heinous. Why not try >> somthing a little more common sensical: > >> double(x) = { x*2 } > > Hmm. But that doesn't allow for clean, anonymous lambdas. I see > where this is coming from, even though I don't think it's something > that I'd use that much, and though I don't think that the various > forms proposed so far are clean. If I'm reading its intent correctly (create a lambda and assign it to the variable "double"), it seems to me to depend on a kind of "lambda context" for its meaning, very much like "array context" (etc.) in Perl. Normally, double(x) can't be an lvalue. So it involves a kind of scan-ahead to see that there's a code block on the rhs. (Which of course there isn't; I guess this is also predicated on having {} not mean hash any more.) I'd actually prefer to see a keyword or two, over the "context"-style assignment scenario. The fact that this would be the *only* context in which it would work doesn't help. It still can't be understood without recourse to the rhs, which I don't like. David -- David A. Black dblack@wobblini.net