: I'd like to create a keyword called foo.
(intern":FOO")
However, it appears that the symbol |:FOO| can be created. How can I create :foo?
common-lisp
In the utility library, Alexandria has a function called make-keyword
.
(alexandria: make-keyword "FOO")
<=>: FOO
; —EXTERNAL
Intern in the keyword package with intern.
(intern "FOO": keyword)
<=>: FOO
A symbol like ':foo' is an abbreviation for the symbol in the keyword package and can also be considered an abbreviation for 'keyword:foo', so you can create it by interning in the keyword package.
(intern":FOO")
will only create the symbol |:FOO| under the current package.
© 2024 OneMinuteCode. All rights reserved.