Re: lambda-returning defmacro, capture
- From: Juho Snellman <jsnell@xxxxxx>
- Date: 13 Dec 2006 20:32:21 GMT
Pascal Bourguignon <pjb@xxxxxxxxxxxxxxxxx> wrote:
Well, right, but (setf (symbol-value 'sym) val) and (symbol-value 'sym)
seem to be defined independently of the different kind of variable.
So you're right that using sym to access (symbol-value 'sym) in the
case of a non dynamic variable is not specified, but we can use
symbol-value.
But why in the world would anyone do that, if the goal is to get
"global lexicals"? There's a good and simple way to accomplish that,
by using symbol-macros.
By the way, I don't find a clear specification that SYMBOL-VALUE
should access the value of dynamic variables... There's some weak
correlation of the two thru boundp, but that's all I can find.
See the description of the SYMBOL class:
Value
If a symbol has a value attribute, it is said to be bound, and
that fact can be detected by the function boundp. The object
contained in the value cell of a bound symbol is the value of the
global variable named by that symbol, and can be accessed by the
function symbol-value. A symbol can be made to be unbound by the
function makunbound.
[...]
Operations on a symbol's value cell and function cell are sometimes
described in terms of their effect on the symbol itself, but the
user should keep in mind that there is an intimate relationship
between the contents of those cells and the global variable or
global function definition, respectively.
--
Juho Snellman
.
- Follow-Ups:
- Re: lambda-returning defmacro, capture
- From: Pascal Bourguignon
- Re: lambda-returning defmacro, capture
- References:
- Re: lambda-returning defmacro, capture
- From: Andreas Thiele
- Re: lambda-returning defmacro, capture
- From: Pascal Bourguignon
- Re: lambda-returning defmacro, capture
- From: Alex Mizrahi
- Re: lambda-returning defmacro, capture
- From: Juho Snellman
- Re: lambda-returning defmacro, capture
- From: Pascal Bourguignon
- Re: lambda-returning defmacro, capture
- Prev by Date: Re: Common Lisp from a Unix perspective - barriers to using CL
- Next by Date: Re: lambda-returning defmacro, capture
- Previous by thread: Re: lambda-returning defmacro, capture
- Next by thread: Re: lambda-returning defmacro, capture
- Index(es):
Relevant Pages
|