考虑一个评估名称是字符串的变量的问题:
(defun string-dereference ()
(interactive)
(let ((myStr "rst-adjust"))
;; (describe-function 'myStr) => Symbol's function definition is void: myStr
;; (funcall (format "(describe-function '%s)" myStr) => Invalid function: "(describe-function 'rst-adjust)")
)
以下工作
(describe-function 'rst-adjust)
如果rst-adjust
存储在字符串中,我该怎么做?
修改:
答案是:
(describe-function (intern myStr))
答案 0 :(得分:7)
intern
是您正在寻找的功能:
(let ((my-str "rst-adjust"))
(intern my-str))
==> rst-adjust