方案:关于cond

Sam*_*prk 2 lisp scheme

(cond ((test-1) (expression-1)))

当我使用cond时,我可以在(表达式-1)中给出几个函数吗?

像这样:

(cond ((= 1 1) ((fun1) (fun2)) )

mic*_*slm 7

begin实际上是可选的- cond(方案以及在Emacs Lisp中,至少)采取多个表达式每个测试表达后并依次评价它们在一个隐式begin

(cond ((= 1 1) (fun1 ...) (fun2 ...))
      (t (something-else)))
Run Code Online (Sandbox Code Playgroud)

使用#t而不是tScheme