From: "rodrigo.bermejo@..." Date: 2003-03-27T07:15:36+09:00 Subject: Re: syntax irb(main):006:0> class Fixnum irb(main):007:1> def inc(val=1) irb(main):008:2> self += val irb(main):009:2> end irb(main):010:1> end SyntaxError: compile error (irb):8: Can't change the value of self self += val ^ from (irb):10 irb(main):011:0> ^C (%:~)- ruby -v ruby 1.6.7 (2002-03-19) [i386-linux] Robert wrote: >class Fixnum > def inc(val=1) > self += val > end >end > >1.inc > >:-) > >"Stephan K�mper" schrieb im >Newsbeitrag news:b5t2t0$2cuq4p$1@ID-96582.news.dfncis.de... > > >>daniel wrote: >> >> >>>hello, >>> >>>in c++ I can write ``i++��. >>>The same in ruby: ``i=i+1��. >>> >>> >>Hi Daniel, >> >>how about >> >>i += 1 ? >> >> >>And, no there's no way to do i++ in Ruby. For a discussion search this >>news group (resp. mailing list). >> >>Happy programming >> >>Stephan >> >> >> >> > > >