From: Will Deakin
Subject: defpackage
Date: 
Message-ID: <3C484E83.8000306@hotmail.com>
Poking through various bit of code I have seen at least four 
different idioms for defpackage:

(defpackage bernard
    (:nicknames :bern)
    (:use :common-lisp))

(defpackage ':bernard
    (:nicknames ':bern)
    (:use ':common-lisp))

(defpackage #:bernard
    (:nicknames #:bern)
    (:use #:common-lisp))

(defpackage "BERNARD"
    (:nicknames "BERN")
    (:use "COMMON-LISP"))

There was a thread last year talking about this but having waded 
through it on google, I am not much the wiser. I tend to write 
defpackage using the first version. Is this wrong? Does this 
intern lots of un-gc'able cruft? and if so should I use the 
symbol'd form (that is the ':bernard syntax) or the uninterned 
symbol form?

Best Regards,

Will Deakin

From: Tim Bradshaw
Subject: Re: defpackage
Date: 
Message-ID: <ey3665zbkiz.fsf@cley.com>
* Will Deakin wrote:

> There was a thread last year talking about this but having waded
> through it on google, I am not much the wiser. I tend to write
> defpackage using the first version. Is this wrong? Does this intern
> lots of un-gc'able cruft? and if so should I use the symbol'd form
> (that is the ':bernard syntax) or the uninterned symbol form?

I do this:

(defpackage :foo
  ...
  (:export #:foo1 ...))

I do this because I'd kind of like to say 

(defpackage "FOO" ... (:export "FOO1")) but I got bitten badly by this
with ACL code and modern mode.  I'd kind of like to use uninterned
symbols everywhere, so (defpackage #:foo ...), but I also type
(in-package ...) quite a lot and I find it's somehow easier to type
(in-paclahe :foo).  I use gensyms for the exports because they only
get mentioned once. I don't use unqualified symbols for anything
because I don't like the idea of lots of spurious internage in the
current package.

--tim
From: Tim Bradshaw
Subject: Re: defpackage
Date: 
Message-ID: <ey31ygnbjw5.fsf@cley.com>
* I wrote:
> ...but I also type
> (in-package ...) quite a lot and I find it's somehow easier to type
> (in-paclahe :foo).  

This may explain why I end up in the debugger so much...
From: Vladimir Zolotykh
Subject: Re: defpackage
Date: 
Message-ID: <3C485AC0.7462F016@eurocom.od.ua>
In ACL we see

cl-users(557): (pprint (macroexpand-1 '(defpackage foo (:nicknames foo) (:use baz))))

(eval-when (compile eval load) (excl::defpackage-1 '#:foo '((:nicknames #:foo) (:use #:baz))))
cl-user(558): 

In CMUCL we see for example

* (macroexpand-1 '(defpackage :foo (:nicknames foo) (:use baz)))

(EVAL-WHEN (COMPILE LOAD EVAL)
  (KERNEL:%DEFPACKAGE "FOO"
                      '("FOO")
                      'NIL
                      'NIL
                      'NIL
                      '("BAZ")
                      'NIL
                      'NIL
                      'NIL
                      'NIL))
T
* 

So I think you should prefer third or fourth forms.

Will Deakin wrote:
> 
> Poking through various bit of code I have seen at least four
> different idioms for defpackage:
> 
> (defpackage bernard
>     (:nicknames :bern)
>     (:use :common-lisp))
> 
> (defpackage ':bernard
>     (:nicknames ':bern)
>     (:use ':common-lisp))
> 
> (defpackage #:bernard
>     (:nicknames #:bern)
>     (:use #:common-lisp))
> 
> (defpackage "BERNARD"
>     (:nicknames "BERN")
>     (:use "COMMON-LISP"))
> 
> There was a thread last year talking about this but having waded
> through it on google, I am not much the wiser. I tend to write
> defpackage using the first version. Is this wrong? Does this
> intern lots of un-gc'able cruft? and if so should I use the
> symbol'd form (that is the ':bernard syntax) or the uninterned
> symbol form?
> 
> Best Regards,
> 
> Will Deakin

-- 
Vladimir Zolotykh                         ······@eurocom.od.ua
From: Will Deakin
Subject: Re: defpackage
Date: 
Message-ID: <3C4BDC8C.7040108@hotmail.com>
For everybody who replied: thank you for your help.

:)w