From: Amy Caplan
Subject: Q: classname/namespace confusion
Date: 
Message-ID: <4bkovn$24h@nkosi.well.com>
In the code below, I would have thought that the  'shadow'  would be 
enough to override the name vector locally to this package.  I tried
this in two good commercial lisp implementations, and both gave fairly
unintelligible errors when doing (defclass vector ...).

Anyone know what I'm doing wrong here? 

    (defpackage :d3
      (:use :common-lisp)
      (:shadow "vector")
      (:export #:vector)
    (in-package :d3) )

    (defclass foo () ((slot1) (slot2)))
    (defclass vector (foo) ())

Thanks for any insight!
(Does anyone else feel that packages are usually more trouble than they're
worth, especially because the same result could be achieved with careful 
naming conventions?)

From: Ken Anderson
Subject: Re: Q: classname/namespace confusion
Date: 
Message-ID: <KANDERSO.95Dec27095750@lager.bbn.com>
In article <··········@nkosi.well.com> ····@well.sf.ca.us (Amy Caplan) writes:

  Anyone know what I'm doing wrong here? 
  
      (defpackage :d3
        (:use :common-lisp)
        (:shadow "vector")
        (:export #:vector)
      (in-package :d3) )
  
      (defclass foo () ((slot1) (slot2)))
      (defclass vector (foo) ())
  
You are shadowing the symbol |vector|, try (:shadow "VECTOR") instead.

  Thanks for any insight!
  (Does anyone else feel that packages are usually more trouble than they're
  worth, especially because the same result could be achieved with careful 
  naming conventions?)

Package problems can be annoying, but packages can also be useful.
From: Jeff Dalton
Subject: Re: Q: classname/namespace confusion
Date: 
Message-ID: <DKoAKG.M98.0.macbeth@cogsci.ed.ac.uk>
In article <······················@lager.bbn.com> ········@lager.bbn.com (Ken Anderson) writes:
>In article <··········@nkosi.well.com> ····@well.sf.ca.us (Amy Caplan) writes:
>
>  Anyone know what I'm doing wrong here? 
>  
>      (defpackage :d3
>        (:use :common-lisp)
>        (:shadow "vector")
>        (:export #:vector)
>      (in-package :d3) )
>  
>      (defclass foo () ((slot1) (slot2)))
>      (defclass vector (foo) ())
>  
>You are shadowing the symbol |vector|, try (:shadow "VECTOR") instead

Or saying #:vector in the :shodow as well as the :export.

>  Thanks for any insight!
>  (Does anyone else feel that packages are usually more trouble than they're
>  worth, especially because the same result could be achieved with careful 
>  naming conventions?)
>
>Package problems can be annoying, but packages can also be useful.

True.  But they're more of a pain then they should be, I think,
for small programs.  Things work best if you put the defpackage
in a separate file and make sure it's processed before any file
that does an in-package to that package.  In-package should be
the first form in a file.

When doing this spearate file stuff, it's helpful to have something
like defsystem that will arrange to compile and load all the files
that make up a "system".  Defsystem is, unfortunately, not a standard
part of CL, but versions are available on the net.

-- jeff