15 May 11:24
Re: Singleton methods on Float and Bignum
From: Matthias Wächter <matthias <at> waechter.wiz.at>
Subject: Re: Singleton methods on Float and Bignum
Newsgroups: gmane.comp.lang.ruby.core
Date: 2008-05-15 09:24:27 GMT
Subject: Re: Singleton methods on Float and Bignum
Newsgroups: gmane.comp.lang.ruby.core
Date: 2008-05-15 09:24:27 GMT
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
RSS Feed