(define function1 (lambda(val)
(if (list? val)
(function2 (val))
('!list))))
Run Code Online (Sandbox Code Playgroud)
当我尝试输入'(ttt)时,我收到以下错误:
application: not a procedure;
expected a procedure that can be applied to arguments
given: (t t t)
arguments...: [none]
Run Code Online (Sandbox Code Playgroud)
我已经定义了function2,它可以在我自己调用它时工作,但是我无法在function1中调用它.
问题是这val不是一个功能.此时应更换(function2(val))使用(function2 val).
此外'!list也不是一个功能; if表达式的else子句也需要更正.