0
intern
何をしているようです。たぶん(intern (read sym))
。しかし、それは何のためですか?アレクサンドリアとは何ですか:確実なシンボルですか?
(if (keywordp x)
(alexandria:ensure-symbol x)
x)
どのような場合はキーワードですか、シンボルではないかもしれませんか?
intern
何をしているようです。たぶん(intern (read sym))
。しかし、それは何のためですか?アレクサンドリアとは何ですか:確実なシンボルですか?
(if (keywordp x)
(alexandria:ensure-symbol x)
x)
どのような場合はキーワードですか、シンボルではないかもしれませんか?
keywordは、もちろん、常にsymbolです。 x
はkeyword(KEYWORD
パッケージにインターンsymbol)であれば、それが持つ「普通の」シンボルを返す:問題の
機能が
(declaim (inline ensure-symbol))
(defun ensure-symbol (name &optional (package *package*))
"Returns a symbol with name designated by NAME, accessible in package
designated by PACKAGE. If symbol is not already accessible in PACKAGE, it is
interned there. Returns a secondary value reflecting the status of the symbol
in the package, which matches the secondary return value of INTERN.
Example:
(ensure-symbol :cons :cl) => cl:cons, :external
"
(intern (string name) package))
すなわちとしてdefinedで、あなたのコードスニペットは、このありません現在のパッケージ*package*
に格納されている同じ名前(それ以外の場合はx
を返します)。
Lisp開発環境では、通常、キーボードの組み合わせメタを使用できます。そのソースコードにアクセスするためのシンボルを表示します。いくつかの開発環境は、 '(ed 'some-function-name)'をサポートし、それぞれのソースコードでエディタウィンドウを開きます。 –