From: dblack@... Date: 2006-07-29T05:07:16+09:00 Subject: Re: does ":" have an anolog in another language? Hi -- On Sat, 29 Jul 2006, Chad Perrin wrote: > On Sat, Jul 29, 2006 at 04:18:28AM +0900, Matt Todd wrote: >> A simple way to describe it may be to look at it as a singleton object >> in that, every unique symbol is a different object, but all of the >> same symbols are the same object. >> >> For instance... >> >> x = Foo.new('bar') >> y = Foo.new('bar') >> z = Foo.new('baz') >> >> Both x and y will be the same object, but different references. But z >> will be different because its value is different. The only way I can >> think of reproducing this in any other language is to create this >> weird version of a Singleton class. Should we call it a >> Unique-Singleton pattern? > > I'm perfectly happy with "object-oriented symbol", but that might be > because Ruby is (100%-ish) object-oriented, and I knew about symbols in > the Lisp idiom before encountering Ruby. Ruby symbols really do just > appear to be the same thing as Lisp symbols, except you can send them > messages in the Ruby idiom. I'd just call them symbols, or Symbol objects (just as with strings, arrays, etc.). 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.