This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

what is difference between : and :#

3 posts · 3218 views

I was curious about the difference if any between something like
(defpackage :dummy
(:use :cl))
and
(defpackage #:dummy
(:use #:cl))
which is preferred?

Re: what is difference between : and :#

:word creates a symbol in the keyword package; it will remain during the life of your program.
#:word creates a symbol in no package; it will presumably be garbage collected after use.

In both cases, symbol-name is used to create a new symbol (by name). The benefit of using these instead of "word" is that they undergo the default case translation whereas a string literal does not.

Thus there is a minor memory benefit to using #:word.

Re: what is difference between : and :#

nice explanations thx