(define (smallest x y z)
(define min x)
(cond ((< y min) (define min y))
((< z min) (define min z))
(se (define min x)))
min)
我正在尝试创建一个简短的过程,该过程返回三个数字中的最小值。似乎条件表达式不能是定义,因为我收到此错误:
begin (possibly implicit): no expression after a sequence of internal definitions in:
(begin (define min y))
(define min y)
您对我实际上在做错什么有任何建议,使用表达式部分的定义是否有问题?如果是这样,您将如何解决这个问题?预先感谢!
问题中的代码有两个问题: