In a screen cast on Common List the author uses uninterned symbols for package names and exports.
(defpackage #:foo
(:use :cl)
(:export #:bar
#:baz))
(in-package #:foo)
He also uses the sharp sign in front of anonymous functions.
(defun transposed (m)
(make-instance 'matrix
:rows (matrix-cols m)
:cols (matrix-rows m)
:generator #'(lambda (i j) (matrix-at m j i))))
In the book Practical Common Lisp the sharp sign isn't used for package names and exports as far as I have read.
What's the reason for using the uninterned symbols (the sharp sign) in these cases?
#'
is a shorthand for thefunction
operator (this is used a few times in the Practical Common Lisp book).Using an interned symbol pollutes the package you're currently in with symbols that are only used for their names anyway:
Uninterned symbols don't do that:
You can also use strings directly, but since you're usually dealing with uppercase symbol names, they are less convenient to write:
Example
To illustrate the problem, consider the following interaction: