From: Phrogz Date: 2007-09-08T03:20:08+09:00 Subject: Re: self-calling method On Sep 7, 8:51 am, "Simon Schuster" wrote: > On 9/7/07, Erik Veenstra wrote: > > What's the advantage of toBase36, compared to the built-in > > to_s(36)? > > > p toBase36(30) > > p 30.to_s(36) > whaaaa, changing the base of a string? this is totally bizarre to me. > > 003:0> p 10.to_s > "10" > nil > 004:0> p 10.to_s(14) > "a" > nil Er, you're not changing the base of a string. (That would be something like 10.to_s.to_base(14).) You're changing the number to be represented as a string in a specific base, via an argument to the to_s method.