[suby-talk] "Is" and ideas for moving foward
Peter Vanbroekhoven
calamitas at advalvas.be
Tue Oct 4 16:11:56 EDT 2005
On Sun, 25 Sep 2005, TRANS wrote:
> I was thinking that in the future only mathods starting a new line (or
> after a semi-colon) could forgo the parens. So
>
> irb(main):003:0> a b 1
> (irb):3: warning: parenthesize argument(s) for future version
> => 1
> irb(main):005:0> a( b 1 )
> (irb):5: warning: parenthesize argument(s) for future version
> => 1
>
> but
>
> irb(main):004:0> a b( 1 )
> => 1
>
> So "m(a b)" isn't allowed. It would have to be one of the two:
>
> m(a(b)) or m(a,b)
>
> That's seems to leave the door open for
>
> m(a b) === m(a,b)
>
> I'm trying to think of a case were there is an ambiguity and no
> reasonabe default interpretation --or no way to use parens to
> disambiguate b/c it causes further ambiguity, but I can't yet think of
> one.
Well, I think your proposal will work. The version without brackets causes
trouble when it is nested, so if you only allow it at the toplevel of the
expression then there should be no problem. I don't know how easy it is
though to convince bison of that...
Peter
More information about the suby-talk
mailing list