[Gardeners] Potting Soil: Count the Colons
Pascal Bourguignon
pjb at informatimago.com
Fri Apr 28 18:01:50 CDT 2006
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?
>
> e.g.
> (defpackage mypackage
> (:use :common-lisp)
> (:export :foo :bar))
> Vs.
>
> (defpackage mypackage
> (:use :common-lisp)
> (:export foo bar))
>
> Now that I think about it, I've seen people use keyword symbols for the
> package names too.
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 prefer to use strings (in programs):
(defpackage "MYPACKAGE"
(:use "COMMON-LISP")
(:export "FOO" "BAR"))
Interactively, I've been observed using keywords.
--
__Pascal Bourguignon__ http://www.informatimago.com/
"Klingon function calls do not have "parameters" -- they have
"arguments" and they ALWAYS WIN THEM."
More information about the Gardeners
mailing list