In Common Lisp package definition, what is the difference between
(defpackage #:foo
(:use :cl)
(:export #:bar
#:baz))
(in-package #:foo)
and
(defpackage :foo
(:use :cl)
(:export :bar
:baz))
(in-package :foo)
I mean. When I have to use the "#" character? All these symbols are uninternerd, right?
:foo
is the syntax for a keyword symbol, and #:foo
is the syntax for an uninterned symbol. When a symbol is used primarily to get at the string that is its name (as in defpackage
and in-package
), I prefer to use uninterned symbols.
Here are the other options:
Which style you or anyone else uses is a matter of taste.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With