--1926193751-1258951320-12219383446195 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-1258951320-1221938344=:16195" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-1258951320-12219383446195 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Sun, 21 Sep 2008, Trans wrote: > > On Sep 20, 11:25 ¨Âí¬ ¢Ôèïíᮼôðò®®®Àçíáéì®ãïí¾ ÷òïôåº > >> Nice idea. After some modification (using method_missing) it could be >> used as a temporary patch on Ruby 1.8, as in Ruby 1.9 symbols are going >> to respond to most string-like methods. > > I'm curious to see which methods. But I take it just some methods have > been added, no type of inheritance is going on, right? Ie. If we > extend String, it won't effect Symbol in any way. Or is there some > magic going on in 1.9 here? >> (Symbol.instance_methods(false) & String.instance_methods(false)).sort => [:<=>, :==, :=~, :[], :capitalize, :casecmp, :downcase, :empty?, :encoding, :inspect, :intern, :length, :match, :next, :size, :slice, :succ, :swapcase, :to_s, :to_sym, :upcase] >> Symbol.ancestors => [Symbol, Comparable, Object, Readline, Kernel, BasicObject] >> String.ancestors => [String, Comparable, Object, Readline, Kernel, BasicObject] David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates! --1926193751-1258951320-12219383446195-- --1926193751-1258951320-12219383446195--