From: Chanwoo Yoo
Subject: About differences between #: and : in defpackage
Date: 
Message-ID: <b6f67ec9-612c-4363-9306-524520e95ff3@z17g2000hsg.googlegroups.com>
In Practical Common Lisp, I read that keywork symbols and string
designators can be used to define defpackage form as follows:

(defpackage :com.gigamonkeys.email-db
  (:use :common-lisp))

(defpackage "COM.GIGAMONKEYS.EMAIL-DB"
  (:use "COMMON-LISP"))

I also read that #: means uninterned symbol which does not belong to
any package, like symbols generated by gensym.

When I try to read real code, for example, lisp-unit or weblocks, I
saw that #: is used to define defpackage form. I merely guess its
purpose is to avoid name conflict. But I'm not sure. And if each time
the reader reads a #: name, it creates a new symbol, then #:lisp-unit
in defpackage and #:lisp-unit in in-package represent different
symbols, I guess. But that's not make sense.

(cl:defpackage #:lisp-unit
  (:use #:common-lisp)
  (:export #:define-test #:run-all-tests #:run-tests ...

(in-package #:lisp-unit)

(defpackage #:weblocks-asd
  (:use :cl :asdf)
  (:nicknames :wop)
  (:export #:test #:test-op #:doc #:doc-op #:make-app #:make-app-op))

(defpackage :com.gigamonkeys.text-db
  (:use :common-lisp)
  (:export :open-db
           :save
           :store))

What are the differences of purpose between #: and : in the above
examples? Thanks in advance.

From: Pascal Bourguignon
Subject: Re: About differences between #: and : in defpackage
Date: 
Message-ID: <87myrj8xwk.fsf@thalassa.informatimago.com>
Chanwoo Yoo <·········@gmail.com> writes:
> [...]
> When I try to read real code, for example, lisp-unit or weblocks, I
> saw that #: is used to define defpackage form. I merely guess its
> purpose is to avoid name conflict. But I'm not sure. And if each time
> the reader reads a #: name, it creates a new symbol, then #:lisp-unit
> in defpackage and #:lisp-unit in in-package represent different
> symbols, I guess. But that's not make sense.


Both #1=#:abc and #2=#:abc designate the same strings, "ABC" and "ABC"
and "ABC" and ...

Try:

(values (string= '#:abc '#:abc)
        (string= '#:abc  ':abc)
        (string= '#:abc   'abc)
        (string= '#:abc  '"ABC"))


-- 
__Pascal_Bourguignon__               _  Software patents are endangering
()  ASCII ribbon against html email (o_ the computer industry all around
/\  1962:DO20I=1.100                //\ the world http://lpf.ai.mit.edu/
    2001:my($f)=`fortune`;          V_/   http://petition.eurolinux.org/
From: Madhu
Subject: Re: About differences between #: and : in defpackage
Date: 
Message-ID: <m34pdrjtfb.fsf@robolove.meer.net>
* Chanwoo Yoo<····································@z17g2000hsg.googlegroups.com>  Wrote on Sat, 5 Jan 2008 17:50:57 -0800 (PST):
|
| What are the differences of purpose between #: and : in the above
| examples? Thanks in advance.

This was just discussed this last week.

See the thread titled "A Question about DEFPACKAGE syntax" on
comp.lang.lisp starting at Andreas Davour's article[1]
<····················@Psilocybe.Update.UU.SE>

<URL:HTTP:groups.google.com/group/comp.lang.lisp/browse_thread/thread/4a8f0f8bb30d6dea/2a5d97d8cb9a5141>

Personally I recommend the suggestions in[2]
<·································@news-europe.giganews.com>

<URL:http://groups.google.com/group/comp.lang.lisp/msg/2a5d97d8cb9a5141>
-- 
Madhu

For the google impaired the Message IDs are:
[1] (cs9abnva18l.fsf @ Psilocybe.Update.UU.SE)
[2] (joswig-00E937.17570928122007 @ news-europe.giganews.com)
From: Chanwoo Yoo
Subject: Re: About differences between #: and : in defpackage
Date: 
Message-ID: <2ee1a222-8b35-4102-8a38-01e9f4afc8d8@v67g2000hse.googlegroups.com>
Thanks for replies! It's my fault that I did not search enough.