From: Eric Mahurin Date: 2005-08-05T08:59:47+09:00 Subject: Re: new block notation (was: Re: ruby-dev summary 26468-26661) --- Yukihiro Matsumoto wrote: > |f = { : a,b=1|2 : ... } > |f = { : * : ... } # equivalent to f = lambda { ... } > > Unfortunately :+space causes conflicts as well. It does? How so? I said :+space to not conflict with the :symbol syntax (could be a hash), just like the ? : operator. I also don't think this conflicts with the ? : operator. If you have this: f = { : a = cond ? x : y : ... } That middle : should obviously be interpreted as part of the ? : operation. Similar to the way a newline doesn't terminate a statement if it is in the middle of the statement. Another option would be to use the ;/newline punctuation to separate the args from the code: f = { : a, b ; ... } or f = { : a, b ... } If you didn't have to deal with hash ambiguities and you could say that the arg list is required, I'd suggest this (remove the : above): f = { a,b ; ... } f = { a,b ... } f = { ; ... } f = { ... } To me that is about the prettiest you could get. Just my 2 cents. BTW, I noticed that lambdas without args now is interpreted as no args allowed instead of any number of args allowed: f = lambda { "xyz" };p(f["hi"]) wrong number of arguments (1 for 0) (ArgumentError) 1.8.2 allows this. Was this change intentional? ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs