[Gardeners] How to name symbols

Stuart Sierra mail at stuartsierra.com
Fri Apr 28 20:09:03 CDT 2006


Pascal Bourguignon <pjb at informatimago.com> writes:
> Jonathan Fischer writes:
>> Ditto the thanks!  I've a question though: is there any difference
>> between using the keyword symbols and normal symbols in the exports
>> list?
>
> Yes.
> Try this:
>
> (in-package :cl-user)
> (defpackage mypackage
>   (:use :common-lisp)
>   (:export foo bar))
> (use-package 'mypackage)
>
> Remember that symbols are interned by the reader when they are read,
> in the current package.
>
> You can use :keywords, or #:uninterned-symbols, or "STRINGS".

I was thinking, as I wrote about colon syntax (glad people
liked it, by the way) that it would be helpful to explain
the various ways of identifying symbols by name when
creating packages and the like.  Many standard macros accept
1) normal interned symbols, 2) keyword symbols, 3)
uninterned symbols, or 4) strings.  I think the HyperSpec
calls these arguments "designators."

It's not always clear which form one should use, and
different styles abound.  Is there a "standard" way?

-Stuart


More information about the Gardeners mailing list