From: Harry Ohlsen Date: 2001-12-11T08:42:09+09:00 Subject: [ruby-talk:28152] Re: Perl/Python Module Porting In article <20011208144936.A911@prism.localnet>, "Massimiliano Mirra" wrote: > On Sat, Dec 08, 2001 at 01:29:52PM +0900, Mathieu Bouchard wrote: >> 2. In Ruby, there is _no_ equivalent to SCALAR. In Ruby, variables are >> not objects; in Perl they are fcv ("first-class value") > > Is that the reason why something like this cannot be done? > > class Integer > def double! > self = self * 2 > end > end > > SyntaxError: compile error > Can't change the value of self Interesting. I've never tried to do that. I guess that's just because Integer doesn't provide access to its data via methods. Of course, that's probably "a good thing". I'd hate to have to write all my arithmetic expressions like "y.val = 2.val * x.val + 5.val" :-).