From: "David A. Black" Date: 2005-08-05T00:25:07+09:00 Subject: Re: ruby-dev summary 26468-26661 --8323328-1500228497-1123169102=:17693 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-1500228497-1123169102=:17693" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1500228497-1123169102=:17693 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Thu, 4 Aug 2005, [ISO-8859-1] Brian Schr=F6der wrote: > On 04/08/05, David A. Black wrote: >> Hi -- >> >> On Thu, 4 Aug 2005, [ISO-8859-1] Brian Schr=F6der wrote: >> >>> [snip] >>> >>> Then why don't we use two different delimiters, e.g. (,) which would >>> even unify with method declaration. >>> >>> { (a, b=3D12) a+b } >>> is quite clear, and counting nesting parenthesis has to be done in any >>> parser so this >>> >>> { (a=3D12, (b,c) =3D [1,2]) a+b**c } >>> is also possible >> >> However, { (a) } would be ambiguous. (I don't particularly mind living >> without default values in blocks, but I think () wouldn't fly.) > > One could disambiguate this the same way it is done with methods: > > { () (a) } > > like in > > def anonymus() (a) end But then you'd have empty parens all over the place. I guess there aren't that many paramless blocks, but there are some, like: Hash.new { () [] } # ugh > or one could use a differnt pair of symbols, though I don't really like t= hat. > > { a+b } irb(main):005:0> def x(a =3D 1 > 0); p a; end =3D> nil irb(main):006:0> x true :-) David --=20 David A. Black dblack@wobblini.net --8323328-1500228497-1123169102=:17693-- --8323328-1500228497-1123169102=:17693--