On Thu, Jan 24, 2008 at 11:01:42AM -0800, [EMAIL PROTECTED] wrote:
On Thu, Jan 24, 2008 at 04:35:29AM -0800, Andrew Lentvorski wrote:
>Are the terms 'abstraction', 'symbol' and 'variable' the same in
>Lisp/Scheme?

No.

But, but <snivel>.....an "abstraction" *is* a symbol.  And what is a variable
if not a symbol?  What is the difference?

It's the same as the distinction between English words, and the things they
represent.  You are not the word "Chris", but Chris refers to you.  "Mr.
Seberino" also refers to you, but is a different symbol.

Let's try some definitions and see if we can get close to both an
understanding, and what they might mean here.

  In scheme and lisp, a symbol is a specific kind of object.  It has a name
  associated with it (how you refer to it), and can be bound to one
  (scheme) or more values (lisp).

  In scheme, since there is only thing bound to a symbol, all symbols can
  be variables (it's possible to have a symbol with nothing bound to it).
  Usually, symbols with functions bound to them aren't thought of as
  variables, although scheme doesn't make the distinction.

When we get to binding and scope, we'll see a little bit more complexity
than this.  The English analogy would be that there are different people
that Chris could refer to, and context tells us which one we are referring
to.  Fortunately, Scheme's context rules are a little simpler than spoken
language.

  An abstraction is, well, an abstract concept.  But, Chatper 2 starts
  talking about how to build up abstractions using data.  The only
  relationship that an abstraction has to variables is that you need a
  place to store them, and that's what variables are for.

Integers are also an abstraction.  They aren't necessarily even represented
as machine words (try (* 1290384192384 19485309485234) for example).

David

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to