Re: Understanding #' and function variables

From: Pascal Bourguignon (spam_at_thalassa.informatimago.com)
Date: 02/02/04


Date: 02 Feb 2004 19:44:05 +0100

Frode Vatvedt Fjeld <frodef@cs.uit.no> writes:

> Dave Roberts <ldave@re-move.droberts.com> writes:
>
> > Okay, I think I'm getting there. Maybe an implementation example to clarify
> > a bit:
> >
> > So a simplistic implementation of a variable might be:
> > struct variable {
> > lisp_object * value;
> > symbol * symbol;
> > }
>
> This is quite incorrect. A variable is an association between (from) a
> name (in the variable name-space) and a value. This association can be
> of many kinds, neither of which match your struct very well, to my
> knowledge.

I think this is wrong, a variable is not an association between a
_name_ and a value. In my undestanding, a variable is a _place_
(where values can be referenced from).

A symbol has five places (name, package, value, function and plist).

A cons has two places (car, cdr) oops, I mean (first, rest), ah, it's
the same, the name does not matter!

A lexical variable has one place. For a lexical variable, we use a
symbol to name it (or its place). The name of a lexical variable
exists only in the source up to the compile time. At run-time, this
name is not remembered.

> In both cases, what a variable "is" is a poor question from a
> beginner. It's best to accept the abstraction on its own terms and
> just understand what it provides and how you use it.

Indeed.

-- 
__Pascal_Bourguignon__                     http://www.informatimago.com/
There is no worse tyranny than to force a man to pay for what he doesn't
want merely because you think it would be good for him.--Robert Heinlein
http://www.theadvocates.org/


Relevant Pages

  • Re: Is it possible to delete an element from a sorted array with O(1) time?
    ... Then why did it take a dozen posts to clarify? ... Is it possible to delete an element from a sorted array with Otime? ... Sorry, that is incorrect. ... Then your question would have to be refined with extra constraints and requirements -- I would not accept separate amendments and clarifications, just a new complete question -- in turn answered by a concrete example, and so on. ...
    (comp.programming)
  • Re: Is it possible to delete an element from a sorted array with O(1) time?
    ... Then why did it take a dozen posts to clarify? ... What took some discussion to clarify was another poster's notion that the question "had" to imply a special set of requirements that that poster imagined. ... that's incorrect as regarding the original question. ...
    (comp.programming)
  • Re: raise level of only one paragaraph without affecting the rest
    ... Okay, you need to clarify whether you are typing in Outline View, or in Page ... Layout View. ...
    (microsoft.public.word.pagelayout)
  • Re: Eddas violent reaction in 9CWL
    ... I don't think that kicking near someone ... >> You are incorrect. ... >> is battery. ... > Okay. ...
    (rec.arts.comics.strips)
  • Re: Cantor Confusion
    ... the uncountability of the reals. ... Okay, you don't have such a need. ... According to you, the question is incorrect. ... Virgil babbles because he is incapable of understanding. ...
    (sci.math)