Re: Understanding #' and function variables
From: Pascal Bourguignon (spam_at_thalassa.informatimago.com)
Date: 02/02/04
- Next message: Pascal Bourguignon: "Re: Understanding #' and function variables"
- Previous message: Pascal Bourguignon: "Re: Lexical variables (Understanding #' and function variables)"
- In reply to: Frode Vatvedt Fjeld: "Re: Understanding #' and function variables"
- Next in thread: Erann Gat: "Re: Understanding #' and function variables"
- Reply: Erann Gat: "Re: Understanding #' and function variables"
- Reply: Frode Vatvedt Fjeld: "Re: Understanding #' and function variables"
- Reply: Dave Roberts: "Re: Understanding #' and function variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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/
- Next message: Pascal Bourguignon: "Re: Understanding #' and function variables"
- Previous message: Pascal Bourguignon: "Re: Lexical variables (Understanding #' and function variables)"
- In reply to: Frode Vatvedt Fjeld: "Re: Understanding #' and function variables"
- Next in thread: Erann Gat: "Re: Understanding #' and function variables"
- Reply: Erann Gat: "Re: Understanding #' and function variables"
- Reply: Frode Vatvedt Fjeld: "Re: Understanding #' and function variables"
- Reply: Dave Roberts: "Re: Understanding #' and function variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|