Matthias Wächter | 15 May 11:24

Re: Singleton methods on Float and Bignum

On 5/15/2008 5:33 AM, Joel VanderWerf wrote:
> x = 1.0
> def x.foo; end
> (1.0).foo   # what should happen here?

x="abc"
def x.foo; end
"abc".foo     # what should happen here?

I don't see your point. You can create new objects in various ways, while Strings and Floats just make it
easier for you. I don't even see why there is no special built-in type of Fixnum (and nil/true/false) is
available that can easily be passed by reference, just for convenience, which would allow applying
singletons as well.

- Matthias


Gmane