A symbol and a variable are two different things. A symbol is
essentially a special kind of literal, just like a number or a string
is. You cannot assign values to symbols, just like you can't assign
values to numbers or strings -- they are their own values. That is, it
makes no sense to say `42 = "banana"`, just as it makes no sense to
say `:banana = 42`.
In this case, the author is using the symbol :largecave to represent a
particular location. The reason why he might prefer a symbol literal
to a string literal is that symbols are immutable. "Immutable" means
that you can't do operations on symbols to change them (unlike, say,
strings). Immutability is a good property because it decreases that
number of surprises you can have, and because it makes reasoning about
your program easier.
~ jf
--
John Feminella
Principal Consultant, BitsBuilder
LI:
http://www.linkedin.com/in/johnxf
SO:
http://stackoverflow.com/users/75170/