Stephen Waits
3/9/2006 12:49:00 AM
Jeff Cohen wrote:
>
> Looks great, Steve. Thanks for publicizing it.
Thanks.
> I'm wondering, how much confusion was there over symbols? Were the
> dynamic-language folks more comfortable with symbols than the others?
> This is one thing I sometimes find is hard to explain to someone who is
> new to Ruby.
I explained it to them that as a programmer we'd basically use symbols
very similarly to how we use enums in C/C++. I showed how they're
commonly used as keys in hashes.
I explained that each symbol has a unique ID, and that Ruby uses symbols
to look stuff up within its own system. I believe I had given them
several ".send(:symbol)" examples at that point.
I showed them :symbol.to_i, and :symbol.class too.
I *think* they understood it. I didn't notice any difference between
the dynamic experienced and the rest.
--Steve