Topic: Definition of Ruby Symbols
I'm wondering if this is a decent definition of what symbols are:
"A symbol type--symbols are effectively pointers to strings stored in a hash table. So you can test equality by comparing a pointer, instead of comparing each character."
I've been looking for something that explains the "implementation" of symbols, but usually get "read the C source code" (which I'm about to do...) or "it doesn't really matter how their implemented".
Now, the definition above seems pretty concise and definitive. I think it's interesting that I found it in a discussion about the nine principles of LISP: http://www.paulgraham.com/icad.html
Also from Ruby for Rails there is a mention that symbols are strings without the overhead (which makes sense since strings are classes with all those methods...) Of course they're immutable and always refer to the same thing.
There's also the point that they are used internally when you assign a variable.
Anyone else care to chime in on the specifics of symbol implementation--anyone read the C code?