Google Groupes n'accepte plus les nouveaux posts ni abonnements Usenet. Les contenus de l'historique resteront visibles.

defparameter at compile-time...

13 vues
Accéder directement au premier message non lu

David Bakhash

non lue,
7 mai 1999, 03:00:0007/05/1999
à
hi,

I'm trying to figure out when defparameter does its thing.

I have a function that I absolutely want to be determined at load-time. Other
functions depend on it:

(defparameter *temp-dir*
(generate-temp-dir-name))

Is there a way to guarantee that this fn gets called at at load time? Is it to just do:

(eval-when (load)
(defparam ...))

or is it to do:

(defparam *temp-dir*
(load-time-value (generate-temp-dir-name)))

?

dave

David Bakhash

non lue,
7 mai 1999, 03:00:0007/05/1999
à

Erik Naggum

non lue,
8 mai 1999, 03:00:0008/05/1999
à
* David Bakhash <ca...@bu.edu>

| I'm trying to figure out when defparameter does its thing.

DEFPARAMETER does its thing at load-time. however, the symbol is
declared special at compile-time, also.

what do you do and observe that lead you to do think you need something
special to make it work at load-time?

#:Erik

Nick Levine

non lue,
10 mai 1999, 03:00:0010/05/1999
à
load-time-value is the one to use:

(defparam *temp-dir*
(load-time-value (generate-temp-dir-name)))

- nick


0 nouveau message