From: Tamas K Papp on
Hi,

I am not completely clear on the applications of the #: read macro for
uninterned symbols. Redshank inserts it everywhere before symbols
(defsystem, in-package, and other forms), but AFAIK ASDF loading
happens in a temporary package anyway, so it should not be necessary.
Nevertheless, I have seen ASDF files peppered with #: all over the place,
so maybe I am mistaken.

When is it "good style"/recommended to use #:?

Tamas
From: Tim Bradshaw on
On 2010-04-06 10:31:52 +0100, Tamas K Papp said:

> When is it "good style"/recommended to use #:?

I think it's good style when you want a name, and you want that name to
obey the current upper/lowercase rules that the reader has, but you
don't want to intern a symbol in whatever package is current.

Good examples of this are export lists &c in package definitions.

From: Pascal Costanza on
On 06/04/2010 11:31, Tamas K Papp wrote:
> Hi,
>
> I am not completely clear on the applications of the #: read macro for
> uninterned symbols. Redshank inserts it everywhere before symbols
> (defsystem, in-package, and other forms), but AFAIK ASDF loading
> happens in a temporary package anyway, so it should not be necessary.
> Nevertheless, I have seen ASDF files peppered with #: all over the place,
> so maybe I am mistaken.
>
> When is it "good style"/recommended to use #:?

There is no reason to worry too much about it. Using just keywords is fine.


Pascal

--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
From: Tamas K Papp on
On Tue, 06 Apr 2010 12:40:16 +0200, Pascal Costanza wrote:

> On 06/04/2010 11:31, Tamas K Papp wrote:
>> Hi,
>>
>> I am not completely clear on the applications of the #: read macro for
>> uninterned symbols. Redshank inserts it everywhere before symbols
>> (defsystem, in-package, and other forms), but AFAIK ASDF loading
>> happens in a temporary package anyway, so it should not be necessary.
>> Nevertheless, I have seen ASDF files peppered with #: all over the
>> place, so maybe I am mistaken.
>>
>> When is it "good style"/recommended to use #:?
>
> There is no reason to worry too much about it. Using just keywords is
> fine.

Great! This is what I wanted to hear :-)

Thanks,

Tamas

From: Zach Beane on
Tamas K Papp <tkpapp(a)gmail.com> writes:

> Hi,
>
> I am not completely clear on the applications of the #: read macro for
> uninterned symbols. Redshank inserts it everywhere before symbols
> (defsystem, in-package, and other forms), but AFAIK ASDF loading
> happens in a temporary package anyway, so it should not be necessary.
> Nevertheless, I have seen ASDF files peppered with #: all over the place,
> so maybe I am mistaken.
>
> When is it "good style"/recommended to use #:?

I mostly use #: out of habit, and because I don't prefer the
alternatives:

- all uppercase strings look a bit ugly to me, and theoretically don't
work in "modern mode" (though I've never run into a practical
problem with that)

- keywords get interned in the keyword package and show up in apropos output

- plain symbols might get interned in unexpected packages, and that
used to cause FASL problems in SBCL and might still cause a problem
in other implementations; Allegro CL had the problem a few years
ago, haven't tried it recently

Zach