From: David Alan Black Date: 2001-10-27T07:03:25+09:00 Subject: [ruby-talk:23543] Re: Issues with white space [was Re: Bruce Eckel's opinion of Ruby] Hello -- On Sat, 27 Oct 2001, Raja S. wrote: > > > No, I understand this, and it makes sense... why isn't it a parse error? > > It doesn't seem like you should be able to drop arbitrary parens in the > > source just anywhere you please. IE, > > +20) / 2) > >should produce a parse error, n'est pas? Why, then, should the above code > >be interpreted as it is? Parenthesis should have the highest precidence of > >any element... don't they? > > You are right that parens have the highest precedence, but no parens are > being dropped: > > ( 8 > + 20 ) is identical to ( 8 ; +20 ) to the Ruby interpreter. > > No syntax error. > > But ( 8 > * 20) is ( 8 ; * 20 ) given the lack of a unary interpretation to > > '*' it is a syntax error. Here's another fun variant: candle:~/hacking/ruby$ ruby -e 'a = ( 10 % 9 ); p a' "9" :-) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav