Hi --

On Thu, 5 Jan 2006, Dave Howell wrote:

> 	A Symbol is just a modest, simple string. It's optional; I could 
> always use a String instead.

That depends.  If you're calling a method that insists on a Symbol
argument, you have to use a Symbol.  Many methods are written to
accept either, though.

> It's good for  naming things that are 'inside' my program, and that
> won't need to be modified, input, output, or generally fiddled with.

Since the "is a string" thing has resonances with classes and
hierarchies and so on, it's also possibly helpful to think of it as:
Ruby has two ways of representing *text*: String and Symbol.  Or
something like that.

> or
>
> A Symbol is a non-variable variable (aka a constant) that always and only 
> contains its own name.

Well, Ruby has variables and constants, and symbols aren't either of
them :-)  I guess they're constant, informally, but they're not
constants, as defined by the language.  I wouldn't call them variables
in any sense.


David

-- 
David A. Black
dblack / wobblini.net

"Ruby for Rails", from Manning Publications, coming April 2006!
http://www.manning.com/books/black