From: Mario Frasca
Subject: use of colon
Date: 
Message-ID: <slrn8uonmo.mh5.mario@tamino.cs.uu.nl>
Is one colon or two correct when separating package and symbol?

USER(13): (export 'bar)
T
USER(14): (in-package mine)
#<The MINE package>
MINE(15): user:bar
4
MINE(16): user::bar
4
MINE(17): user:non-existant
Error: Symbol "NON-EXISTANT" not found in the COMMON-LISP-USER package.
  [condition type: READER-ERROR]
[1] MINE(18): :res
MINE(19): user::non-existant
Error: Attempt to take the value of the unbound variable
       `COMMON-LISP-USER::NON-EXISTANT'.
  [condition type: UNBOUND-VARIABLE]

Restart actions (select using :continue):
 0: Try evaluating COMMON-LISP-USER::NON-EXISTANT again.
 1: Set the symbol-value of COMMON-LISP-USER::NON-EXISTANT and use its value.
 2: Use a value without setting COMMON-LISP-USER::NON-EXISTANT.
 3: Return to Top Level (an "abort" restart)
[1] MINE(20): :res
MINE(21): 

so there is a difference...  or there's not?

also 'ANSI Common Lisp' by Graham leaves me in doubt, look at page 238,
where both forms are used (three times ':', once '::').

From: Barry Margolin
Subject: Re: use of colon
Date: 
Message-ID: <FwZG5.4$RJ.120@burlma1-snr2>
In article <····················@tamino.cs.uu.nl>,
Mario Frasca <·····@cs.uu.nl> wrote:
>Is one colon or two correct when separating package and symbol?

One is enough for external symbols, two are required to access internal
symbols.  Usually you shouldn't need to access internal symbols, so if you
need to use two colons you should think hard about whether you really
should be calling that function.

-- 
Barry Margolin, ······@genuity.net
Genuity, 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: Rainer Joswig
Subject: Re: use of colon
Date: 
Message-ID: <joswig-E4CF89.16455517102000@news.is-europe.net>
In article <····················@tamino.cs.uu.nl>, ·····@cs.uu.nl 
(Mario Frasca) wrote:

> Is one colon or two correct when separating package and symbol?
> 
> USER(13): (export 'bar)
> T
> USER(14): (in-package mine)
> #<The MINE package>
> MINE(15): user:bar
> 4
> MINE(16): user::bar
> 4
> MINE(17): user:non-existant
> Error: Symbol "NON-EXISTANT" not found in the COMMON-LISP-USER package.
>   [condition type: READER-ERROR]
> [1] MINE(18): :res
> MINE(19): user::non-existant
> Error: Attempt to take the value of the unbound variable
>        `COMMON-LISP-USER::NON-EXISTANT'.
>   [condition type: UNBOUND-VARIABLE]
> 
> Restart actions (select using :continue):
>  0: Try evaluating COMMON-LISP-USER::NON-EXISTANT again.
>  1: Set the symbol-value of COMMON-LISP-USER::NON-EXISTANT and use its value.
>  2: Use a value without setting COMMON-LISP-USER::NON-EXISTANT.
>  3: Return to Top Level (an "abort" restart)
> [1] MINE(20): :res
> MINE(21): 
> 
> so there is a difference...  or there's not?
> 
> also 'ANSI Common Lisp' by Graham leaves me in doubt, look at page 238,
> where both forms are used (three times ':', once '::').

You need to read a bit about packages in Lisp.

FOO::BAR references the symbol named "BAR" in package FOO.

FOO:BAR FOO::BAR references the symbol named "BAR" in package FOO,
if FOO exports this symbol. Otherwise it is an error.

Usually exporting a symbol indicates that it is belongs
to an interface of a piece software. If it is
not exported, the original author usually means that it
is not wise to use it outside of this package directly.
Common Lisp provides this mechanism to hide symbols,
but in a long tradition, there is a way to directly
reference non-exported symbols. Some "modern"
"software-engineers" sure wouldn't like it. ;-)

-- 
Rainer Joswig, Hamburg, Germany
Email: ·············@corporate-world.lisp.de
Web: http://corporate-world.lisp.de/