From: Tamas Papp
Subject: confused about in-package
Date: 
Message-ID: <87646wtrqz.fsf@pu100877.student.princeton.edu>
Hi,

I am trying to learn packages (from Practical Common Lisp).  When I
run the following code in SLIME:

(defpackage :foo
  (:use :common-lisp))

(in-package :foo)

and then check *package*, I get

;;;; (defpackage :foo   (:use :common-lisp)) ...
;;;; (in-package :foo) ...
CL-USER> *package*
#<The COMMON-LISP-USER package, 4/9 internal, 0/9 external>

Shouldn't *package* hold foo after the in-package?  My understanding
(from the book) that it should, maybe I am doing something wrong.

Thanks,

Tamas

-- 
Posted via a free Usenet account from http://www.teranews.com

From: Pascal Bourguignon
Subject: Re: confused about in-package
Date: 
Message-ID: <87odkoh3xp.fsf@thalassa.lan.informatimago.com>
Tamas Papp <······@gmail.com> writes:

> Hi,
>
> I am trying to learn packages (from Practical Common Lisp).  When I
> run the following code in SLIME:
>
> (defpackage :foo
>   (:use :common-lisp))
>
> (in-package :foo)
>
> and then check *package*, I get
>
> ;;;; (defpackage :foo   (:use :common-lisp)) ...
> ;;;; (in-package :foo) ...
> CL-USER> *package*
> #<The COMMON-LISP-USER package, 4/9 internal, 0/9 external>
>
> Shouldn't *package* hold foo after the in-package?  My understanding
> (from the book) that it should, maybe I am doing something wrong.

Nothing, but slimes keeps track of different "current packages" for
the different source files.  Evaluting with slime (in-package xyz) in
some source file doesn't modify the *PACKAGE* in the slime-repl.

Try to copy-and-paste (in-package :foo) in the slime-repl and see the
value of *package* in there, or evaluate *package* in the same source
file where you evaluated (in-package :foo).

Have a look at:
http://bc.tech.coop/blog/070424.html

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.
From: Eirik Mikkelsen
Subject: Re: confused about in-package
Date: 
Message-ID: <m2sla0fp9p.fsf@remove-invalid-parts-gmail.com>
Tamas Papp <······@gmail.com> writes:

> ;;;; (defpackage :foo   (:use :common-lisp)) ...
> ;;;; (in-package :foo) ...
> CL-USER> *package*
> #<The COMMON-LISP-USER package, 4/9 internal, 0/9 external>

If you want to change the package *on the repl*, you must do (in-package :foo)
on the repl as well. It looks like you did it via C-M-x.

Eirik
From: Dmitry V. Gorbatovsky
Subject: Re: confused about in-package
Date: 
Message-ID: <f28cnv$rae$1@sxnews1.qg.com>
Tamas Papp wrote:

> Hi,
> 
> I am trying to learn packages (from Practical Common Lisp).  When I
> run the following code in SLIME:
> 
> (defpackage :foo
>   (:use :common-lisp))
> 
> (in-package :foo)
> 
> and then check *package*, I get
> 
> ;;;; (defpackage :foo   (:use :common-lisp)) ...
> ;;;; (in-package :foo) ...
> CL-USER> *package*
> #<The COMMON-LISP-USER package, 4/9 internal, 0/9 external>
> 
> Shouldn't *package* hold foo after the in-package?  My understanding
> (from the book) that it should, maybe I am doing something wrong.
> 
> Thanks,
> 
> Tamas
> 

I find this "tutorial" particularly helpfull :
http://www.flownet.com/gat/packages.pdf

dg