[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: newbie question re: variable assignment

Peña, Botp

4/14/2005 1:39:00 AM

Simon.Mullis@equinoxsolutions.com wrote:

#Just ordered the 2nd Edition (good old Amazon)...
#
#Woohoo!


just to tease ;-)


irb(main):009:0> class Integer
irb(main):010:1> def ascii
irb(main):011:2> self.to_s[0]
irb(main):012:2> end
irb(main):013:1> end
=> nil

irb(main):014:0> 1.ascii
=> 49


irb(main):016:0> 0.upto(9) {|x| p x.ascii}
48
49
50
51
52
53
54
55
56
57

#
#SM
#

btw, you are fortunate. I do not have that book yet.

kind regards -botp