相关疑难解决方法(0)

为什么要做一个特殊的表格?

在Clojure中,为什么是do一个特殊的形式,而不是像这样实现的功能?

(defn do [& exprs]
  (last exprs))
Run Code Online (Sandbox Code Playgroud)

function clojure special-form

6
推荐指数
1
解决办法
123
查看次数

字节编译宏时,"返回的值未使用"警告

为什么字节编译以下会产生警告?

(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)

emacs elisp compiler-warnings emacs24

2
推荐指数
1
解决办法
271
查看次数