I'm sorry, this is a very newbie Common Lisp question.
I'm learning common-lisp and package system.
I started with "The Complete Idiot's Guide to Common Lisp Packages" from http://cl-cookbook.sourceforge.net/packages.html
In Chapter 1, the author defined a function foo in the package :bob
? (make-package :bob)
#<Package "BOB">
? (make-package :jane)
#<Package "JANE">
? (in-package bob)
#<Package "BOB">
? (defun foo () "This is Bob's foo")
FOO
I tested this code line by line in my REPL, but failed:
; SLIME 2.26
CL-USER> (make-package :bob)
#<PACKAGE "BOB">
CL-USER> (make-package :jane)
#<PACKAGE "JANE">
CL-USER> (in-package bob)
#<COMMON-LISP:PACKAGE "BOB">
BOB> (defun foo () "This is Bob's foo")
; in: DEFUN FOO
; (BOB::DEFUN BOB::FOO NIL "This is Bob's foo")
;
; caught COMMON-LISP:STYLE-WARNING:
; undefined function: BOB::DEFUN
;
; caught COMMON-LISP:WARNING:
; undefined variable: BOB::FOO
;
; compilation unit finished
; Undefined function:
; DEFUN
; Undefined variable:
; FOO
; caught 1 WARNING condition
; caught 1 STYLE-WARNING condition
And it told me:
The variable FOO is unbound.
[Condition of type COMMON-LISP:UNBOUND-VARIABLE]
What's the problem?
How to fix this problem and make it work?
Very thanks.
PS: My environment is SBCL + quicklisp + slime.