From: Rudolf Schlatte
Subject: common-lisp-user package
Date: 
Message-ID: <7gqe14$9o0@fstgal00.tu-graz.ac.at>
I just got bitten by 

(defpackage foo (:use common-lisp-user))
(in-package foo)

and everything failing after that.

Is there a reason why cl-user does not export any symbols?
(Just curious, now I just :use cl)

Rudi

From: Barry Margolin
Subject: Re: common-lisp-user package
Date: 
Message-ID: <se3Y2.398$jw4.30977@burlma1-snr2>
In article <··········@fstgal00.tu-graz.ac.at>,
Rudolf Schlatte  <········@ist.tu-graz.ac.at> wrote:
>I just got bitten by 
>
>(defpackage foo (:use common-lisp-user))
>(in-package foo)
>
>and everything failing after that.
>
>Is there a reason why cl-user does not export any symbols?

Because that's not what it's for.  Symbols are generally exported from the
package where they're defined.  Occasionally they'll also be exported from
a package that imports or inherits them, because the importing package is
combining or augmenting the original packages in some way.  But CL-USER is
just intended to be a place where you do your interactive work by default,
not a package that defines things for other software to use.

-- 
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Vassil Nikolov
Subject: Re: common-lisp-user package
Date: 
Message-ID: <7gvdvt$pa5$1@nnrp1.deja.com>
In article <··········@fstgal00.tu-graz.ac.at>,
  Rudolf Schlatte <········@ist.tu-graz.ac.at> wrote:
> I just got bitten by
>
> (defpackage foo (:use common-lisp-user))
> (in-package foo)
>
> and everything failing after that.

You did not write what specifically failed after that.
Was it the case that you got a lot of errors about
undefined functions?  E.g. if there was a DEFUN form
after the above DEFPACKAGE and IN-PACKAGE forms, the
Lisp processor would complain that DEFUN was undefined.

When you supply a :USE argument, your package uses
exactly the listed package(s), no more and no less.
In the above case, FOO uses just COMMON-LISP-USER and
does *not* use COMMON-LISP.

If :USE is not supplied, then the default list of used
packages is implementation-dependent (usually the
programmer has some way to control this default, and
by default the default would include COMMON-LISP).

> Is there a reason why cl-user does not export any symbols?
> (Just curious, now I just :use cl)

Did you expect that CL-USER would re-export the symbols
it inherits from CL?  (It does not do that, of course.
It could be made to do this in one's Lisp initialisation
file, though I can't see why one would want to do that.)


--
Vassil Nikolov <········@poboxes.com> www.poboxes.com/vnikolov
(You may want to cc your posting to me if I _have_ to see it.)
   LEGEMANVALEMFVTVTVM  (Ancient Roman programmers' adage.)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    
From: Rudolf Schlatte
Subject: Re: common-lisp-user package
Date: 
Message-ID: <7h1356$bdn@fstgal00.tu-graz.ac.at>
Vassil Nikolov <········@poboxes.com> wrote:
> In article <··········@fstgal00.tu-graz.ac.at>,
>   Rudolf Schlatte <········@ist.tu-graz.ac.at> wrote:
>> I just got bitten by
>> (defpackage foo (:use common-lisp-user))
>> (in-package foo)
>> and everything failing after that.

> You did not write what specifically failed after that.
> Was it the case that you got a lot of errors about
> undefined functions?  

Yes.

[Snip explanation about :use semantics]

> Did you expect that CL-USER would re-export the symbols
> it inherits from CL?  (It does not do that, of course.

I was exactly wondering about the "of course" bit.  HyperSpec says:

" The COMMON-LISP-USER package can
" have additional symbols interned within it;
" it can use other implementation-defined packages.

So, my thinking was based on the assumption that CL-USER was the
package to use and base one's own work upon, because the 
implementation could do the right thing, in analogy to "If you
use our Visual compiler without our class libraries, you will not
get the whole end-user experience."
[insert smilies as needed]

> It could be made to do this in one's Lisp initialisation
> file, though I can't see why one would want to do that.)

See above.  I like the present behavior better anyway (if you need
something in your package that is not provided by the CL package,
insert it explicitly).  It was just different from what I was
expecting, so I wanted to ask. 

Rudi
From: Kent M Pitman
Subject: Re: common-lisp-user package
Date: 
Message-ID: <sfwd80bv403.fsf@world.std.com>
Rudolf Schlatte <········@fsmtss08.tu-graz.ac.at> writes:

> I was exactly wondering about the "of course" bit.  HyperSpec says:
> 
> " The COMMON-LISP-USER package can
> " have additional symbols interned within it;
> " it can use other implementation-defined packages.
> 
> So, my thinking was based on the assumption that CL-USER was the
> package to use and base one's own work upon, because the 
> implementation could do the right thing, in analogy to "If you
> use our Visual compiler without our class libraries, you will not
> get the whole end-user experience."
> [insert smilies as needed]

The reason it is not the way you expect is exactly that CL-USER is required
to be in every environment.  Since its meaning is different in every
environment, saying what its exports are would mean saying you can expect
standard behavior. By saying exports have to be defined explicitly, not
transitively trhough defsystem and not implicitly by saying things like
you quote above, it forces you to debug your program on the FIRST 
implementation you work on rather than to get it all ready to go and then
be surprised by the SECOND implementation when it doesn't port.