作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图在elisp中将一种方法传递给另一种方法,然后
让那个方法执行它。这是一个例子:
(defun t1 ()
"t1")
(defun t2 ()
"t1")
(defun call-t (t)
; how do I execute "t"?
(t))
; How do I pass in method reference?
(call-t 't1)
最佳答案
首先,我不确定命名您的函数t
是否会有所帮助,因为't'在lisp中用作truth value。
也就是说,以下代码对我有用:
(defun test-func-1 () "test-func-1"
(interactive "*")
(insert-string "testing callers"))
(defun func-caller (callee)
"Execute callee"
(funcall callee))
(func-caller 'test-func-1)
关于emacs - 如何将函数作为参数传递给elisp?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/213267/
我是一名优秀的程序员,十分优秀!