Symbol を文字列にしたい
文字列を Symbol にするには intern を使用すればいいが、その逆もできることがわかった。prin1-to-string という関数を使用すればできる。Symbol のリストを連結して文字列にできる。以下のように使用する。
? (prin1-to-string '(this is a test)) "(THIS IS A TEST)" ?
うーむ、、、括弧もついてしまうのか。。。あと、list を使って動的に prin1-to-string に渡すということもできないようだ。
? (print1-to-string (list 'this 'is 'a 'test.)) > Error: Undefined function PRINT1-TO-STRING called with arguments ((THIS IS A TEST.)) . > While executing: CCL::TOPLEVEL-EVAL, in process Listener(4). > Type cmd-/ to continue, cmd-. to abort, cmd-\ for a list of available restarts. > If continued: Retry applying PRINT1-TO-STRING to ((THIS IS A TEST.)). > Type :? for other options. 1 >
思ったほど使えないかも。