-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2005.12.30 09:36, Chad Perrin <perrin / apotheon.com> wrote:
> On Fri, Dec 30, 2005 at 05:07:35AM +0900, Yohanes Santoso wrote:
> > Chad Perrin <perrin / apotheon.com> writes:
> > 
> > > If that's the case, what's up with all this tripe about "a symbol is
> > > just a name" and so on?
> > 
> > Because it's true? Because there are people who don't have lisp
> > background who are not familiar with what symbol is? Because there are
> > people who thinks symbols are magical thingie?
> 
> It's not really true, though, considering what a symbol is (according to
> my current understanding).  A symbol is an element of a hash table that
> is often used as a name, and it is an (anonymous? not sure how to
> qualify that) object.  Calling it a "name" seems to be confusing common
> use with actual nature, or premature explanation of an abstract way of
> thinking about it, depending on how you mean "it is a name" when you say
> it.  Either way, it seems to be getting the cart before the horse.

Nope, Symbols have nothing to do with Hashes. They are often used
as Hash keys because they are descriptive: h[:foo] is better than 
h[1] if one wants to convey some meaning with the key. In other 
languages, you might use a string instead of a Symbol (and you
can, of course, do so in ruby as well: h['foo']).

> > > I think these analogies are doing a disservice to people trying to
> > > get a read on what a symbol is in Ruby.
> > 
> > This is true for all analogies. Different people are receptive to
> > different analogies. This simply means you are not receptive to the
> > analogy I made.
> 
> I think it's probably more useful to start by describing the actual
> functional nature of a symbol, then start in with the analogies if that
> doesn't make a lightbulb go on in the person's head.
> 
> 
> > 
> > > people are full of analogies and categorical statements
> > > that don't really explain anything
> > 
> > The basic message has always been clear: symbol is a mean for you, the
> > programmer, to name/identify entities. But somehow, people are having
> > difficulty understanding this and asked for more explanations. This is
> > when analogies and categorical statements came in.
> 
> "A means for you, the programmer, to name/identify entities" is not a
> description of what a symbol *is* so much as a description of how you
> can use it.  It seems awfully odd to me that everything else in the
> language tends to get described in terms of what it actually is under
> the hood, then starts getting analogies only if the target of the
> explanation doesn't get it, while for some reason nobody starts an
> explanation of symbols that way in Ruby.
> 
> For example: while saying that a method is "a verb" does help one to
> "get" how verbs are used in the language, nobody really knows what a
> method is until it's explained that it's a mini-algorithm whose
> definition is part of a class definition, accessible by way of instances
> thereof.  As such, someone always starts explaining what a method is
> under the hood pretty quickly when trying to get the point of a method
> across in teaching OOP.  With symbols, though, I keep seeing bland
> assertions that a symbol is "just a name", or "a name that is an
> object", or something like that, without any explanation of what a
> symbol actually does behind the scenes.
> 
> I seem to have missed the blog post that mentioned the relationship to
> Lisp methods, but even that didn't really address the matter as clearly
> as I would have expected.
> 
> 
> > 
> > > While you're at it, define "identifier" within this context.
> > 
> > To help people understanding the meaning of 'identifier', I've been
> > mentioning it together with 'name': 'name/identify' as in "It is just
> > a way to name/identify things".
> > 
> > In any case, there is only one definition of identifier so context
> > should not influence the meaning of it:
> > 
> > >From WordNet (r) 2.0 (August 2003) [wn]:
> > 
> >   identifier
> >       n : a symbol that establishes the identity of the one bearing it
> 
> . . . which, unfortunately, in no way explains what one does with a
> "symbol" in a programming context in a helpful way.
> 
> A symbol is an element (or a reference to an element, though I hesitate
> to use the term "reference" with its programming contextual baggage) in
> a hash table.  A hash table is, in short, a list maintained "by the
> language" rather than by the user.  From the programmer's point of view,
> this list essentially has only values, not keys, though from the
> language's point of view it most certainly has keys.  This is primarily
> useful for applying names to things, thus the common assertion that "a
> symbol is a name".
> 
> Is that close, or have I missed something?


E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDtJmoxvA1l6h+MUMRApdyAJ4tpDcrx5X9ZuP2J9xn5lNLhZfbMQCfbYqG
x9YzyZMOlgYTH1d8ZyBy2OM=
=6asn
-----END PGP SIGNATURE-----