Very confused about packages.
- From: pillsbury@xxxxxxxxx
- Date: 29 Jun 2006 21:23:10 -0700
I'm what you would probably call a hobbyist programmer, and I've been
recently working on teaching myself Common Lisp. I've generally been
quite pleased with how many good, freely available resources there are
for CL, and one of the things I've been working on is the exercises in
a book by Shapiro, called /Common Lisp: An Interactive Approach/[1].
I'd been working with SLIME for Aquamacs and OpenMCL 1.0.
However, I found some of the exercises pretty hard, and decided to try
to STEP through some of the code I was working on. OpenMCL doesn't do
that, so I downloaded SBCL and tried that out. And it does STEP just
fine, but I can't get any of the packages I set up to work[2].
In OpenMCL, I had this, and it worked fine:
(defpackage match
(:shadow boundp substitute))
(in-package match)
However, when I tried compiling it in SBCL, I get a message about how
match is an undefined variable. I look at the Hyperspec some, and try
this:
defpackage "match"
(:shadow boundp substitute))
(in-package "match")
And then I get all sorts of errors, like:
The variable |match|::*GRAMMAR-RULES* is unbound.
[Condition of type UNBOUND-VARIABLE]
despite the fact that I have
(defparameter *grammar-rules*
'(((john ?v ?n) ((n john) ?v ?n))
((?n1 loves ?n2) (?n1 (v loves) ?n2))
((?n ?v mary) (?n ?v (n mary)))
((?n1 (v ?v) (n ?n2)) (?n1 (vp (v ?v) (n ?n2))))
(((n ?n1) (vp ?v ?n2)) (s (n ?n1) (vp ?v ?n2)))))
right there in the file. In fact, It appears that evaluating that
statement is what's causing the problem (after compiling the file with
C-c C-k didn't work, I tried just evaluating the region with C-c C-r,
and got the same error message).
I really have no idea what's going on. Any explanation would be greatly
appreciated.
Thanks!
[1] http://www.cse.buffalo.edu/~shapiro/Commonlisp/
[2] The author suggests doing each chapter's exercises, and the two
"projects", in their own packages.
.
- Follow-Ups:
- Re: Very confused about packages.
- From: rsobriquet
- Re: Very confused about packages.
- Prev by Date: Symbolics 3620 for sale in Hawaii
- Next by Date: Re: A logo proposal
- Previous by thread: Symbolics 3620 for sale in Hawaii
- Next by thread: Re: Very confused about packages.
- Index(es):