[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
the KEYWORD package USEing another package
Date: 29 Feb 1988 14:15-EST
Date: 24 Feb 1988 19:20-PST
From: David Bein <firstname.lastname@example.org>
Cf. pg 187: "It is an error to try to use the KEYWORD package."
I don't see any problem with having the KEYWORD package use another package
(I don't see much point to it either). Do you?
Yes there is a problem: you could cause a symbol to be available as a
keyword whose value was not the keyword. E.g:
(setf user::keyword-example nil) ==> nil
(export 'user::keyword-example) ==> t
user:keyword-example ==> nil
(use-package '(user) (find-package 'keyword)) ==> t
:keyword-example ==> nil
:some-other-keyword ==> :some-other-keyword
This would break a lot of programs.
Don't think of keywords as symbols. They are a specialisation of
symbols; they don't have all the attributes (really only the PR and the
plist should be used) of symbols.
I think common-lisp should be explicit that you shouldn't think of them
as having all the attributes of symbols. Perhaps cl should specify that
"it is an error to use the function cell of a keyword," to discourage
people from using them as normal symbols.