On Fri, 10 Nov 2006, paul wrote: > Hi all, > > A little thing that is bugging me is that I don't know how to do a > "count++" (like in Java) in Ruby. I found that Ruby has a method succ / > next, but that still leaves me doing "count = count.succ" A simple > "count.succ!" doesn't seem to exist... > > Now I try to overwrite the class, but I don't know the internal name of > the value stored in the integer class. "self = self + 1" is not valid, > so I tried: > class Integer > def succ! > self.value = succ > end > end > , but value is not a valid name. When browsing the internet I found > some C code (is *all* of Ruby written in C?). In this C code I found > some names like 'int_int_p' and 'VALUE', but those don't seem right > either... > > Anyone?... it can't be done in ruby. there are many thing which can't be done in java which can be done in ruby and vise versa - better to learn the idioms and use them. search the arvhices for more - it's come up many, many times. -a -- my religion is very simple. my religion is kindness. -- the dalai lama