On 18.04.10 07:07, Caleb Clausen wrote:
> The small improvement in readability didn't seem worth the trouble to
> me. But to my surprise, nobu just went ahead and implemented it. I'm
> still wondering about the general case.
I'm surprised, too. I thought at most, a change would be made in Ruby
2.0. My argument was pro-discussion, not pro-change.

>> An improved even-spaces rule for the ternary operator might really help.
> Can you be specific? I vaguely recall there being some unique special
> cases around ternaries, but the details elude me.
What I meant was a behavior like this one:

  ruby -wce 'p /4'
  warning: ambiguous first argument; put parentheses or even spaces

As far as I understood, the idea behind this is that an ambiguous symbol
is an operator if it's used in the form "a:b" or "a : b", and a prefix /
opening delimiter if it is used in the form "a :b" or "a(:b)". I have no
specific idea how to minimize surprise while retaining backwards
compatibility. But the more code example we have, the better we can
decide. Your examples are great:

>   p=0; p %[foo]
>   p=0; p /foo/x
>   p=0; p &foo
>   p=0; p *foo
>   p=0; p ?f : g
>   p=0; p <<foo
> 123
> foo

In addition:

  p=0; p +foo
  p=0; p -foo

If we really change syntax, all of these should be interpreted as p(...).

But it might not be a good idea to change it suddenly in 1.9.2.

[murphy]