Hi --

On Fri, 30 Dec 2005, Eero Saynatkari wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>> On Fri, 30 Dec 2005, dblack / wobblini.net wrote:
>>
>> This assertion by me seems to have been mercifully ignored in
>> subsequent discussion :-)  Actually, s = :sym doesn't produce a
>> reference to :sym; rather, s has the actual/immediate value :sym.
>> Anyway, the main (obscured) point was that symbols are not references.
>
> This is another bad aspect of Symbol explanations. Sooner or later
> someone mentions 'immediate values' or 'internal symbol tables'.
> While accurate (and in some cases, useful knowledge), these are a
> big source of confusion and not in any way helpful to understanding
> the fairly trivial function of Symbols :/

"Immediate value" is not a useless or arcane notion.  (And I did *not*
mention the internal symbol table :-)  In fact, understanding that
some variable assignments result in variables that hold immediate
values, and others result in variables that hold references, is quite
important, if you want to understand, for example, the whole lack of
post-increment operator thing (i.e., the fact that, given x = 1, x++
and 1++ are the same expression, etc.).

I agree that part of the problem with people understanding Symbols is
the tendency to expect, and look for, more than is there -- but I'd
maintain that to understand Ruby identifiers fully, you really need to
be aware of the (not terribly difficult) notion of immediate values
vs. references.


David

-- 
David A. Black
dblack / wobblini.net

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