Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!newsfeed.internetmci.com!howland.reston.ans.net!EU.net!peer-news.britain.eu.net!newsfeed.ed.ac.uk!edcogsci!jeff
From: jeff@cogsci.ed.ac.uk (Jeff Dalton)
Subject: Re: Q: classname/namespace confusion
Message-ID: <DKoAKG.M98.0.macbeth@cogsci.ed.ac.uk>
Organization: Centre for Cognitive Science, Edinburgh, UK
References: <4bkovn$24h@nkosi.well.com> <KANDERSO.95Dec27095750@lager.bbn.com>
Date: Thu, 4 Jan 1996 20:07:28 GMT
Lines: 37

In article <KANDERSO.95Dec27095750@lager.bbn.com> kanderso@lager.bbn.com (Ken Anderson) writes:
>In article <4bkovn$24h@nkosi.well.com> amyc@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
