在Clojure中,为什么是do一个特殊的形式,而不是像这样实现的功能?
(defn do [& exprs]
(last exprs))
Run Code Online (Sandbox Code Playgroud) 为什么字节编译以下会产生警告?
(defmacro foomacro (shiftcode)
`(defun foo (&optional arg)
(interactive ,(concat shiftcode "p"))
(message "arg is %i" arg))
`(defun bar (&optional arg)
(interactive ,(concat shiftcode "Nenter a number: "))
(message "arg is %i" arg)))
;; provide backward compatibility for Emacs 22
(if (fboundp 'handle-shift-selection)
(foomacro "^")
(foomacro ""))
Run Code Online (Sandbox Code Playgroud)
这是我收到的警告:
$ emacs -Q --batch --eval '(byte-compile-file "foo.el")'
In foomacro:
foo.el:1:21:Warning: value returned from (concat shiftcode "p") is unused
Run Code Online (Sandbox Code Playgroud)
如果我摆脱bar,警告就会消失:
(defmacro foomacro (shiftcode)
`(defun foo (&optional arg)
(interactive ,(concat shiftcode "p")) …Run Code Online (Sandbox Code Playgroud)