Larry Wall wrote:

> Yes, that's a convenient escape.  But really, arguments from principle
> aside, the underlying question is what someone will see if they look
> at 1.e5, and I suspect most people will see a number with an exponent.
> This is a spot where Ruby violates Least Surprise, at least for people
> who aren't used to seeing methods hanging off of literals.

To the original point, I have to seriously question the usefulness of
invoking ambiguously named methods on numeric literals...

    1e5      # number
    1.0e5    # number
    (1).e5   # method call, since you really mean it

The decimal point without a fractional part looks bizarre to me:

    1.e5     # syntax error

Surely +. and -. are invalid syntax? << (\.\d+)? >>, not << (\.\d*)? >>.

Gordon Henriksen

Reply via email to