您不能从Scheme中的函数返回任何内容吗? [英] Can you return nothing from a function in Scheme?
本文介绍了您不能从Scheme中的函数返回任何内容吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写一个方案解释器,对于if语句,例如:
I'm writing a scheme interpreter, and in the case of an if statement such as:
(if (< 1 0) 'true)
我尝试过的所有解释器都将返回一个新提示.但是,当我对此进行编码时,对于是否存在替代表达式,我会有一个if.如果什么都没打印出来,我该怎么办?
Any interpreter I've tried just returns a new prompt. But when I coded this, I had an if for whether there was an alternative expression. What can I return in the if such that nothing gets printed?
(if (has-alternative if-expr)
(eval (alternative if-expr))
#f) ;; what do I return here?
推荐答案
查看全文