Re: packages question
Hi Chuck --
I'm not too familiar with CLISP (by which I assume you mean the Common
Lisp implementation called CLISP), but your problem probably has to do
with the packages available in the CLOS package. If the symbol
IN-PACKAGE is not available CLOS package (it is in Lispworks, I don't
know about CLOS), then typing
CLOS> (in-package :cl-user)
will cause an error and you'll end up in the debugger. The reason is
that the current package controls how symbols are interned into the
system, and the reader will intern a new symbol named IN-PACKAGE into
the CLOS package if it is not available there already.
You can investigate the packages available in the, say, the CLOS
package by doing
(package-use-list (find-package :clos))
Alternatively, if you are just trying to leave the CLOS package, and
get back to the CL-USER package, you can always qualify the symbols
explicly, so saying
CLOS> (cl:in-package :cl-user)
should work as you'd expect.
You may find http://www.flownet.com/gat/packages.pdf contains
information to help you understand this better.
best regards,
Klaus Harbo
On 8/10/07, Charles Hoffman <nothinghappens@mchsi.com> wrote:
>
> I've a little bit of experience playing with Common Lisp, and lately
> I've been working on increasing it, towards the goal of eventually being
> able work on some real projects. One thing I wanted to know more about
> is packages.
>
> Running CLISP, I decided to get some practice navigating packages at the
> REPL. At the CL-USER> prompt I evaluated (in-package clos) This
> successfully switched packages, the prompt was now MOP>. Pretty cool.
>
> Problem happened when I tried to change back to the user package. Or
> any other package, really. I got thrown into the debugger with an error
> claiming I couldn't do this because the CLOS package is locked.
>
> Well DUH. I wasn't trying to CHANGE the CLOS package, I was just trying
> to leave it. Eventually I gave up and just restarted SLIME. What's the
> deal here?
>
> --chuck--
>
>