P
paul
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?...
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?...