;; STEP 1: Define a class
(defclass foo ()
((xxx :initarg :xxx)))
(make-instance 'foo :xxx 1)
;; STEP 2: use nstring-capitalize in the keyword symbol
(nstring-capitalize (symbol-name :xxx))
;; STEP 3: try to make of instance of class
(make-instance 'foo :xxx 1)
The result is:
Invalid initialization argument: :XXX in call for class #
[Condition of type SB-PCL::INITARG-ERROR]
See also:
Common Lisp Hyperspec, 7.1.2 [section]
Backtrace:
0: (SB-PCL::CHECK-INITARGS-2-PLIST (:XXX 1) #
According to http://www.lispworks.com/documentation/HyperSpec/Body/f_symb_2.htm
"symbol-name returns the name of symbol. The consequences are undefined if name is ever modified."
Shame on me.
Nenhum comentário:
Postar um comentário