[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to eval. this code without a warning
- To: jbell@garnet.berkeley.edu, info-mcl@cambridge.apple.com
- Subject: How to eval. this code without a warning
- From: William M. York <York@CHUCK-JONES.west.dialnet.ila.com>
- Date: Mon, 1 Jun 1992 11:35-0700
- In-reply-to: <101605INN6s2@agate.berkeley.edu>
Date: Wed, 27 May 1992 16:29 PDT
From: jbell@garnet.berkeley.edu (John E. Bell)
I need to evaluate code such as the following without getting a warning
about an undefined function appearing in the Listener:
(let ()
(load "foo.lisp")
(bar))
where bar is a function contained in the file foo.lisp. Bar is unbound before
loading foo.lisp. How can I do it?
A general trick for fooling the reader/evaluator/compiler into
ignoring references to unresolved functions is to use FUNCALL and
INTERN:
(let ()
(load "defines-bar-in-foo-package")
(funcall (intern "BAR" "FOO")))
This is particularly useful for cases where the FOO package does not
exist at the time you define this form. It stops the reader from
barfing when it sees FOO:BAR.