in reply to Re^3: I dislike object-oriented programming in general
in thread I dislike object-oriented programming in general

The reason why that doesn't work is a legacy error in the ECMAScript standard. By following a numeral with a dot, the parser expects that you're defining a floating-point value, rather than an integer. You can still call methods on it, however, if you disambiguate by wrapping it in parentheses first.
(5).foo();

Replies are listed 'Best First'.
Re^5: I dislike object-oriented programming in general
by tilly (Archbishop) on Oct 21, 2007 at 04:00 UTC
    Ah. That makes perfect sense.

    When you put it that way, I'm a little surprised that Ruby correctly understands this:

    class Fixnum; def hello () puts 'hi'; end; end; 5.hello;
    A reply falls below the community's threshold of quality. You may see it by logging in.