Hi --

On Mon, 7 Mar 2005, Nikolai Weibull wrote:

> * Yukihiro Matsumoto (Mar 06, 2005 14:50):
>
>>> Isn't that a little bit awkward-looking?  Or am I just being too
>>> sensitive about new forms of significant punctuation in the
>>> language?
>
>> Maybe, maybe not.  It's very subjective matter.
>
> Definitely.  I'd write it as
>
> 	x = lambda { ... }
>
> if there weren't any arguments.  It'd make it much more clear that it
> was a thunk and nothing else.
>
> (If there were arguments I'd consider skipping the proc/lamda:
>
> 	x = { |a| ... }
> ),

I'm trying to figure out why I don't like this (including the {||...}
form.

I think it's because it requires visual backtracking.  When I see:

   x = {

I read it as a hash constructor.  With the lambda possibility, I have
to read further, and *then* understand what the { meant.

   x = {|     # OK, that { was *not* a hash constructor

Even though {...} can also be a block, there's never any ambiguity or
backtracking required:

   x.y {       # block
   x.y({       # hash

so by the time the { is reached, it's clear what it means.

I guess I don't like having the meaning of the { be undetermined by
what is on its left.  At least that's my current shot at analyzing why
this syntax change doesn't appeal to me.


David

-- 
David A. Black
dblack / wobblini.net