[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OK, so I have a package reference in my init file...

    Date: Mon, 4 Jun 90 22:19 EDT
    From: pan@Athena.Pangaro.Dialnet.Symbolics.Com (Paul Pangaro)

    This also works, as it turns out (I had logical sense reversed when
    debugging, sorry) .....

    (when (find-package 'fred)
     (sct:pkg-bind 'fred (setq foo nil)))   ; really fred:foo

How can that possibly get FRED:FOO?  The PKG-BIND happens when the form
is executed, which is *after* it has been read, and symbols are interned
at read time.

We make judicious use of (funcall (find-symbol "NAME" 'package) ...)
around here.  We also use #+ for some things; as Kent pointed out, this
only works if there's a feature associated with the package, but this is
easy enough to arrange:

	(when (find-package "DFS")
	  (pushnew :dfs *features*))

Note also that #+ is generally only useful for this if you always load
the source file.  If you compile the file then the #+ happens at compile
time, and the wrong things will happen if the existence state of the
package is different at load time.