From: Christian Neukirchen Date: 2005-11-10T03:20:31+09:00 Subject: Re: Question about symbols "David A. Black" writes: > Hi -- > > On Wed, 9 Nov 2005, Jacek Olszak wrote: > >> Hi everyone... >> >> I've just read the Pragmatic Programming Ruby book. But I don't >> understand one thing : why should I use symbols (colon sign before >> the variable name) ie. :name ? > > See the other answers for details and interesting stuff.... I just > wanted to clarify the point that you're not putting the colon before a > variable name, but before the string of which this is the equivalent > symbol. You can even do: > > :"This is a symbol with whitespace" > > or even the String#intern method: > > "So is this".intern Just note that you can't intern strings with null-byte. > David -- Christian Neukirchen http://chneukirchen.org