我在下面有一个此功能,可让它打印您输入的列表(iota 1 10),因此在列表中打印数字 1-10(1 2 3 4 5 6 7 8 9 10)。我如何将其更改为仅取一个数字并仍从列表中的 1-(所选数字)打印。我只是想不通我应该怎么做。谢谢。
(define iota
(lambda(x y)
(cond((> x y)
'())
(else
(cons x
(iota (+ 1 x)y))))))