<div dir="ltr"><div><div>Hi.</div><div>This code fragment works with (LOAD "/tmp/foo.lisp") but not (COMPILE-FILE "/tmp/foo.lisp")</div><div><br></div><div><div><font face="courier new, monospace">(eval-when (:compile-toplevel :load-toplevel :execute)</font></div>
<div><font face="courier new, monospace"> (defvar *count* 0)</font></div><div><font face="courier new, monospace"> (macrolet ((something (sym) `(setf (get ,sym 'uniqueid) (incf *count*))))</font></div><div><font face="courier new, monospace"> (defun register-it (x) (something x))))</font></div>
<div><span style="font-family:'courier new',monospace">(eval-when (:compile-toplevel :execute)</span><br></div><div><font face="courier new, monospace"> (format t "~&OK so far~%")</font><br></div><div>
<font face="courier new, monospace"> (register-it :foo))</font></div><div><span style="font-family:'courier new',monospace">(eval-when (:compile-toplevel :execute)</span><br></div><div><font face="courier new, monospace"> (format t "~&Got ~D~%" (symbol-plist :foo)))</font></div>
</div></div><div><br></div><div><div>Armed Bear Common Lisp 1.3.0</div><div>Java 1.7.0_51 Oracle Corporation</div><div>Java HotSpot(TM) 64-Bit Server VM</div><div>Low-level initialization completed in 0.258 seconds.</div>
<div>Startup completed in 1.231 seconds.</div><div>Type ":help" for a list of available commands.</div><div>CL-USER(1): (compile-file "/tmp/foo.lisp")</div><div>; Compiling /private/tmp/foo.lisp ...</div>
<div>; (DEFVAR *COUNT* ...)</div><div>; (DEFUN REGISTER-IT ...)</div><div>OK so far</div><div>#<THREAD "interpreter" {3A284BEE}>: Debugger invoked on condition of type UNDEFINED-FUNCTION</div><div> The function SOMETHING is undefined.</div>
<div>Restarts:</div></div><div>...</div></div>