[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: load-time-eval
What is the meaning of the phrase "When [a use of LOAD-TIME-EVAL] is
compiled to core (by COMPILE-FILE)..." and how does it
differ/relate
to the meaning of the phrase "When a use of LOAD-TIME-EVAL is
compiled
(by COMPILE-FILE)"? They sound the same to me.
I guess there is a typo in my message. I should have said "compiled to
core by COMPILE".
load-time-eval is different than #, because you can use it in a macro
and have part of the macroexpansion evaluated at load-time.
Given:
(defmacro my-macro ()
`(my-macro-run-time-function
(load-time-eval
<form which evaluates to object only known at load time>)))
This defun:
(defun foo ()
(my-macro))
is equivalent to:
(defun foo ()
(my-macro-run-time-function
'#,<form which evaluates to object only known at load time>))