Re: How to process contents of a list variable through a macro ?



On Tue, 20 Feb 2007 13:03:41 +0100, joswig@xxxxxxxxxxxxxxxxxxxxxxx <joswig@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

On Feb 20, 12:34 pm, "John Thingstad" <john.things...@xxxxxxxxx>
wrote:
On Tue, 20 Feb 2007 09:16:48 +0100, jos...@xxxxxxxxxxxxxxxxxxxxxxx

<jos...@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

> A DEFPARAMETER doesn't get executed at compile time.
> But the compiler executes the Macros during compile time.
> Even those that are defined in the file you compile.
> If a macro then references a variable that is in
> the same file...

A DEFPARAMETER does (!) get executed at compile time.
It is a DEFVAR declaration that dosn't.

That's wrong.

CLHS:

If a defvar or defparameter form appears as a top level form, the
compiler must recognize that the name has been proclaimed special.
However, it must neither evaluate the initial-value form nor assign
the dynamic variable named name at compile time.


--
Using Opera's revolutionary e-mail client:http://www.opera.com/mail/



Hyperspec:

"defparameter unconditionally assigns the initial-value to the dynamic variable named name.
defvar, by contrast, assigns initial-value (if supplied) to the dynamic variable named name only
if name is not already bound."

So defvar values get assigned a value when they are first loaded and then remain the same.
defparameter values by contrast get assigned te initial value each time they are evalueated
/compiled.

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
.



Relevant Pages

  • Re: Still not getting it.
    ... Compile time for the creator, ... Vector executes is creates a definition. ... 1024 Vector stimulus OK ... gain and response arrays. ...
    (comp.lang.forth)
  • Re: macro help?
    ... 1-argument defvar doesn't assign the variable and the 2-argument one ... It doesn't make sense to do in a loop. ... As long as the interning is done at compile time, ...
    (comp.lang.lisp)
  • Re: How to conditionally use a specified module
    ... that will still fail if the boolean value is set at runtime since use ... executes at compile time. ...
    (perl.beginners)
  • Re: How to conditionally use a specified module
    ... that will still fail if the boolean value is set at runtime since use ... executes at compile time. ... The if pragma executes at compile time. ...
    (perl.beginners)
  • Re: defconstant warnings
    ... > polynomial expresion at compile time using Horner's rule. ... > My difficulty is that loading the code below multiple times into SBCL ... If you're going to take this route you probably want defvar, ...
    (comp.lang.lisp)