From: keyboard
Subject: what's the difference between : and :: ?
Date: 
Message-ID: <1175592398.805118.92870@p77g2000hsh.googlegroups.com>
I come across some code like
			       (compiler::clear-xref-info t)
			       (setf compiler:*source-level-debugging* nil)

I am wondering why there is ::? : is used as keyword identifier, am I
right?

best regards,
keyboard

From: fireblade
Subject: Re: what's the difference between : and :: ?
Date: 
Message-ID: <1175596585.558623.223770@o5g2000hsb.googlegroups.com>
On Apr 3, 11:26 am, "keyboard" <···········@gmail.com> wrote:
> I come across some code like
>                                (compiler::clear-xref-info t)
>                                (setf compiler:*source-level-debugging* nil)
>
> I am wondering why there is ::? : is used as keyword identifier, am I
> right?
>
> best regards,
> keyboard

You can use :: to refer to symbols in other packages that author
didn't exported.
Basically you're looking for a trouble.

See  www.flownet.com/gat/packages.pdf
or
http://www.gigamonkeys.com/book/programming-in-the-large-packages-and-symbols.html

A name containing only a single colon must refer to an external
symbol--one the package exports for public use. If the named package
doesn't contain a symbol with a given name, or if it does but it
hasn't been exported, the reader signals an error. A double-colon name
can refer to any symbol from the named package, though it's usually a
bad idea--the set of exported symbols defines a package's public
interface, and if you don't respect the package author's decision
about what names to make public and which ones to keep private, you're
asking for trouble down the road. On the other hand, sometimes a
package author will neglect to export a symbol that really ought to be
public. In that case, a double-colon name lets you get work done
without having to wait for the next version of the package to be
released

cheers
bobi
From: Slava Akhmechet
Subject: Re: what's the difference between : and :: ?
Date: 
Message-ID: <873b3hjagd.fsf@gmail.com>
To be fair using :: doesn't always mean you're asking for trouble. For
example, if I want to create a package with unit tests that cover
symbols which aren't exported.

-- 
Regards,
Slava Akhmechet.
From: fireblade
Subject: Re: what's the difference between : and :: ?
Date: 
Message-ID: <1175692834.986366.119980@e65g2000hsc.googlegroups.com>
On Apr 4, 1:37 am, Slava Akhmechet <·········@gmail.com> wrote:
> To be fair using :: doesn't always mean you're asking for trouble. For
> example, if I want to create a package with unit tests that cover
> symbols which aren't exported.
>
> --
> Regards,
> Slava Akhmechet.

Well, don't mess under the hood unless you know what you're doing .
Referencing unexported symbols might mess up the internals
create a spaghetti code, or make your code not working with another
version of the package. But if you got to do it you got to do it,
lisp gives you a choice , the rest is up to you.

cheers
bobi
From: Harald Hanche-Olsen
Subject: Re: what's the difference between : and :: ?
Date: 
Message-ID: <pcofy7g8tgy.fsf@shuttle.math.ntnu.no>
+ Slava Akhmechet <·········@gmail.com>:

| To be fair using :: doesn't always mean you're asking for trouble. For
| example, if I want to create a package with unit tests that cover
| symbols which aren't exported.

Isn't the purpose of testing to ask for trouble?  ;->

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell
From: ······@corporate-world.lisp.de
Subject: Re: what's the difference between : and :: ?
Date: 
Message-ID: <1175623524.269487.285080@e65g2000hsc.googlegroups.com>
On Apr 3, 11:26 am, "keyboard" <···········@gmail.com> wrote:
> I come across some code like
>                                (compiler::clear-xref-info t)
>                                (setf compiler:*source-level-debugging* nil)
>
> I am wondering why there is ::? : is used as keyword identifier, am I
> right?
>
> best regards,
> keyboard


Expanding a bit on the keyword part of your question:


Keywords are all in a package named KEYWORD. The reader recognizes
a symbol :FOO as a symbol with the name FOO in the package KEYWORD.
Additionally all keywords are automatically exported and
evaluate to themselves. Examples:

? ':foo
:FOO

:foo is read as the keyword symbol :foo.

? :foo
:FOO

:foo evaluates to itself

next is a bit unsual because you don't see it that often:

? 'keyword:foo
:FOO

keyword:foo is the same as :foo (an exported symbol in the keyword
package)

? 'keyword::foo
:FOO

keyword::foo is the same as :foo (a symbol in the keyword package)

and finally:

? '::foo
:FOO

::foo is the same as :foo