(cond ((test-1) (expression-1)))
当我使用 cond 时,我可以在 (expression-1) 中给出几个函数吗?
像这样:
(cond ((= 1 1) ((fun1) (fun2)) )
最佳答案
begin
实际上是可选的 -- cond
(至少在 Scheme 和 Emacs Lisp 中)在每个测试表达式之后获取多个表达式并依次计算它们在一个隐含的begin
(cond ((= 1 1) (fun1 ...) (fun2 ...))
(t (something-else)))
Scheme 使用#t
而不是t
关于lisp - 方案:关于条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12561470/