From: "Guy N. Hurst" Date: 2001-03-21T02:16:55+09:00 Subject: [ruby-talk:12961] Re: differences between range and array Kevin Smith wrote: > > Guy N. Hurst wrote: > >Perhaps it could be improved by making the '.' bind more > >tightly than the space? > > > >p (x).to_i # -> p((x).to_i) > >p (x) .to_i # -> (p(x)).to_i > > I thought about that. But then we have problems > with: > > x = Foo.new(1).bar("a") > > I certainly would be surprised to have that > parsed as: > > x = Foo.new( (1).bar("a") ) > I don't see a problem here, because I only meant for the '.' to be higher precedence than a space. If there is no space, than the lack of it is higher than the '.' Foo.new(1).bar("a") #-> (Foo.new(1)).bar("a") Foo.new (1).bar("a") #-> Foo.new((1).bar("a")) Can you think of any problems still? Guy N. Hurst -- HurstLinks Web Development http://www.hurstlinks.com/ Norfolk, VA 23510 (757)623-9688 FAX 623-0433 PHP/MySQL - Ruby/Perl - HTML/Javascript