Nobuyoshi Nakada
3/24/2006 11:49:00 AM
Hi,
At Fri, 24 Mar 2006 18:33:53 +0900,
Phil Tomson wrote in [ruby-talk:185669]:
> class Symbol
> undef_method :to_int
> end
>
> ....that works for my purposes, but I wonder why there is a
> Symbol#to_int method in the library. Why not just require that Symbol#to_i be
> called explicitly if that's what you want?
Histrical reason. Formerly, until Symbol class was introduced
Fixnum was used. Symbol#to_int is deprecated and has been
purged in 1.9.
$ ruby1.8 -ve :foo.to_int
ruby 1.8.4 (2005-12-24) [i486-linux]
-e:1: warning: treating Symbol as an integer
--
Nobu Nakada