From: Steve Litt Date: 2005-12-29T04:47:16+09:00 Subject: Re: What is the difference between :foo and "foo" ? On Wednesday 28 December 2005 02:32 pm, Alex Knaub wrote: > 2005/12/28, Surgeon : > > Hi, > > > > I am a Ruby newbie. I wish I didn't post such a simple question here > > but I had to. > > What is the difference between :foo (a keyword) and "foo"(a string). > > Can they be used interchangeably? Are they fundamentally same and is > > the only difference performance? > > http://onestepback.org/index.cgi/Tech/Ruby/SymbolsAreNotImmutableStrings.re >d The preceding URL tells me unequivically that symbols aren't strings, but really doesn't tell me too much about what they are, other than what, names??? I still don't understand why it's attr_reader :fname, :lname instead of attr_reader @fname, @lname How does attr_reader know that :fname corresponds to @fname. Seems like magic to me. SteveT Steve Litt http://www.troubleshooters.com slitt@troubleshooters.com