将组织电子表格中的列表传递给lisp函数

use*_*450 0 emacs elisp org-mode

我有一个名为TABLE1的表,我正在尝试将列表传递给函数foo,如下所示:

#+TBLFM: $1='(foo list(a b c))

(defun foo (my-list) 
  (first my-list)
)
Run Code Online (Sandbox Code Playgroud)

不幸的是,表公式的计算结果为#ERROR.知道如何将列表传递给函数吗?

Jon*_*pin 5

您需要使用有效的函数才能工作. (foo list(a b c))即使在*scratch*缓冲区中也无法评估.

如果将公式更改为:

(foo (list "a" "b" "c"))
or
(foo (list 'a 'b 'c))
or
(foo '(a b c))
Run Code Online (Sandbox Code Playgroud)

它将a在表字段中返回.