On 18.04.10 04:34, Caleb Clausen wrote:
> In my judgment, this would be too much additional complication in an
> area of the parser/lexer that's already extremely squirelly.
Ironically, it could still make the language easier to use for humans.
Because our eyes are not yacc.

And maybe our eyes are on the right track here. I don't think this
should be valid:

  print = 0
  foo ? print :bar

because the : obviously belongs to :bar. I doubt there's an editor on
this planet which realizes that bar is not a symbol.

Ruby should instead throw a syntax error, unexpected $end, expecting
':'. In other words, an unevenly-spaced colon immediately followed by an
identifier (as in " :bar") should never be interpreted as a ternary
operator colon.

An improved even-spaces rule for the ternary operator might really help.

[murphy]