Re: Common Lisp: Forward reference to a symbol in an unloaded package, possible?



On Apr 28, 7:05 pm, p...@xxxxxxxxxxxxxxxxx (Pascal J. Bourguignon)
wrote:
(defun _load (name)
(let ((asdf (find-package "ASDF")))
(if asdf
(let ((operate (find-symbol "OPERATE" asdf))
(load-op (find-symbol "LOAD-OP" asdf)))
(assert (and operate load-op))
(funcall (symbol-function operate) load-op name))
(error "ASDF has not been loaded."))))

If you find that hard to read, you can do something like the
following:

(defun _load (name)
(declare (special name))
(eval (read-from-string "(asdf:operate 'asdf:load-op name)")))

Anyway, you most probably shouldn't do this. It's evil. Please try
the DEFPACKAGE way before resorting to something nasty that you might
regret later.

Matthias
.