From: Logan Capaldo Date: 2007-01-28T02:40:01+09:00 Subject: Re: Implementation of Symbols... On Sun, Jan 28, 2007 at 02:20:39AM +0900, Michael Cowden wrote: > Ok, I'm sure this one has been addressed ump-teen times, but everything I read, > at least on the rails side, puts symbols in the 'magic' space where you don't need > to know how they're implemented--or what they are for that matter--you just need > to know how to use them. > > Anyway, I've done a bit of programming in C so understanding it in those terms isn't > going to hurt too much... can anyone explain? > > So far, the most elegant explanation comes from a discussion on LISP: > > "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." > Yeah, pretty much. If you really want to see, you can check out some of the code in parse.c in and around the function rb_intern. > from: http://www.paulgraham.com/icad.html > > Is this relevant? > > -Michael Cowden > StoryRight.com > michael.cowden@storyright.com > (443) 519-8662