From: Chad Perrin Date: 2006-07-29T04:26:00+09:00 Subject: Re: does ":" have an anolog in another language? 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. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] Brian K. Reid: "In computer science, we stand on each other's feet."