From: dblack@... Date: 2006-07-29T05:49:47+09:00 Subject: Re: does ":" have an anolog in another language? Hi -- On Sat, 29 Jul 2006, Matt Todd wrote: > In my example, using a symbol would be the same as creating a symbol > object (whose initialize() method was overwritten to pull a > Unique-Singleton deal): > > { :foo => "bar" } > > is the same as > > { Symbol.new('foo') => "bar" } > > (That is, if Symbol had #new defined). > > It's like saying... > > "Hello" > > does the same thing as > > String.new('hello') > > except that it doesn't create a new object for duplicate values, it > simply returns the reference to the previous Symbol object created. Sorry, I'm not following. What purpose would the hypothetical Symbol.new serve? David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy ----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <----- http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log http://www.manning.com/black => book, Ruby for Rails http://www.rubycentral.org => Ruby Central, Inc.