Common lisp Funcall-inside-Cons-Lisp
我刚开始玩Lisp,我正在尝试使用funcall-inside-cons 这就是我想做的:Common lisp Funcall-inside-Cons-Lisp,common-lisp,Common Lisp,我刚开始玩Lisp,我正在尝试使用funcall-inside-cons 这就是我想做的: (cons '(1 2 3) '(1 (funcall #'rest '(a b)) )) 结果应该是: ((1 2 3) 1 (b)) 我知道这是可行的: (cons '(1 2 3) (funcall #'rest '(a b))) 我已经试过了,但没用 (cons '(1 2 3) `,'(1 (funcall #'rest '(a b)) )) (cons '(1 2 3) '(1 (
(cons '(1 2 3) '(1 (funcall #'rest '(a b)) ))
结果应该是:
((1 2 3) 1 (b))
我知道这是可行的:
(cons '(1 2 3) (funcall #'rest '(a b)))
我已经试过了,但没用
(cons '(1 2 3) `,'(1 (funcall #'rest '(a b)) ))
(cons '(1 2 3) '(1 (apply 'rest '(a b))))
(cons '(1 2 3) '(1 `,(apply 'rest '(a b))))
提前感谢。当您引用列表时,列表中的所有内容都被引用,因此没有函数调用。您可以通过以下方式实现您想要的:
[1]> (cons '(1 2 3) (list 1 (funcall #'rest '(a b)) ))
((1 2 3) 1 (B))
[2]>
引用列表时,列表中的所有内容都被引用,因此没有函数调用。您可以通过以下方式实现您想要的:
[1]> (cons '(1 2 3) (list 1 (funcall #'rest '(a b)) ))
((1 2 3) 1 (B))
[2]>
@candiani抱歉,我昨晚没有从我的clisp会话中正确复制粘贴此内容,现在它是正确的。@candiani抱歉,我昨晚没有从我的clisp会话中正确复制粘贴此内容,现在它是正确的。