il Wed, 31 Mar 2004 23:23:46 +1200, "Robo" <robo / mars.com> ha scritto:: > Symbols are like Atoms in other languages -- they are invariant, and a >> symbol only creates a new object if it's the first time it's used. > >I've been wondering about symbols as well. What are some examples of a good >place to use symbols? when you use something related to reflection (method(:sym) is an example) when you need a constant meaning something, insted of the C-like Module::CONST you can just use :const :const is just like a number (immutable and so on) but it has the plus have being meaningful. in general, I even believe using symbols is safer than using string. If you are using a string and do not need it's features (take a look at String.instance_methods ) you may think of using a symbol (even if not everything is allowed as a symbol), avoiding possibly messing up something by changing the string.