On Dec 30, 2005, at 5:39, Devin M. wrote:
Hey, all you lurkers:
Have any of the explanations in the thread (What is the difference
between :foo and “foo” ?) helped you understand symbols?
I’ve just started trying to find these discussions and read them
because I haven’t been at all clear on the difference, so I’ll get back
to you on what does work.
However, although I don’t meant to pick on szpak specifically, he did
provide a sterling example of what doesn’t work, at least for me, and I
have worked professionally as a writer of documentation…
"A symbol in Ruby is similar to a symbol in Lisp
I don’t know Lisp. Or Java. Unless you know that your reader is already
familiar with your reference, it’s not helpful to use it.
in that the symbol is a name, or more precisely a named atom
“Atom” is undefined here. I know what an atom is. My desk is made of
them. This is apparently some other kind of atom…
which can also respond to a request to expose itself as a number
(to_i) or a string (to_s).
Neither names nor atoms respond to requests in my world. The use of
“expose” is even more confusing.
In this case a Ruby symbol is similar to a Lisp keyword symbol
Is a Lisp keyword symbol different than a Lisp symbol?
(which is also prefixed by a colon (:), at least in some versions of
However, in Lisp a symbol has much greater functionality.
For example, a Lisp symbol can also be bound to a value, a property
list, or a function.
I definitely don’t need to know what else a Lisp symbol can do. I
would like to know what Ruby symbols are bound to, if not values,
property lists, or functions. (I’m going to guess “string.”)
In briefest, my understanding of symbol in Ruby is that it is an
interned string used as a name
(“interned” meaning that it is entered into memory as a single, atomic
entity, a monad -
there is just one of it, with a single pointer to it).
Aha. I do know what a string is, and the definition of “interned” is
supplied. However, the definition
isn’t very helpful. We’re back to “atomic,” with the implication that
“normal” strings aren’t atomic.
Then there’s “monad,” but that’s also undefined.
Again, this isn’t intended to be a criticism of szpak specifically. He
just provided a nice short example of what I see over and over again on
this list. I don’t know Lisp. I don’t know Java. I don’t know
Smalltalk. I don’t know PHP, or Python, or Perl, or C (plain, plussed,
objective, or sharp). It’s nice that there are lots of people on the
list who do, and if you’re trying to explain some part of Ruby to them,
by all means, use common references. But don’t assume we newbies know
this stuff until we tell you.
Me, I know SQL, and AppleTalk, and REXX, and Modula-2, and Pascal, and
real (not Real) BASIC, with line numbers. I decided I needed to learn a
new language, something I could script and web and just generally do
whatever I needed to do in. I picked Ruby.
Do I expect the myriad references to Python and Java to suddenly vanish
from the list? Of course not. I’m just saying, if there’s some big
discussion about threading that uses Java as the counterexample, don’t
be surprised if I ask that same question a week later.