From: Austin Ziegler Date: 2005-12-31T05:03:20+09:00 Subject: Re: What is the difference between :foo and "foo" ? On 30/12/05, Steve Litt wrote: > On Friday 30 December 2005 10:35 am, Steve Litt wrote: > [clip] > > With all the controversy, including some piping to a killfile, the issue > > isn't *my* depth of digging, it's either *everyone's* depth of digging, or > > it's an issue of :symbols being a particularly surprising element of Ruby. > > I haven't heard this level of disagreement about blocks, methods, iterators > > and the like. Heck, for two cents I'll document it myself! > > > > SteveT > > The Ruby Newbie Guide to Symbols is here: > > http://www.troubleshooters.com/codecorn/ruby/symbols.htm Steve: Please edit your guide, as it is *not* correct when it says: A Ruby symbol is a thing that has both a number (integer) and a string. This is not correct in any way. If you leave it as "A Ruby Symbol is a thing", you're fine. But when you say that it "has" a number and a string, you are incorrect. Symbols are not composed of the integer or string values that you can convert Symbols to; they just are. The value of a Symbol is not its String value or its Fixnum value, but itself. I strongly recommend rewriting your guide from that perspective, because you are likely to greatly *increase* the confusion of newbies. If you would like, I can see about possibly helping you edit this or coauthor it such that it might become a useful article to be published at Ruby Code & Style to explain where Symbols can be used and what they are. Ultimately, though, trying to dig into the internals of Symbols misses the point -- it's just something that represents itself. -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca