I tried to write a function (simple, i.e. without eqan?) one?, such as:
(define one?
(lambda (n)
((= 1 n))))
But the above does not work, though, when I call it the following:
(one? 1)
I welcome this error:
procedure application: expected procedure, given:
The correct way (from The Little Schemer) to write:
(define one?
(lambda (n)
(cond
(else (= 1 n)))))
Why is there a need to use condwith a sentence elseinstead of just returning (= 1 n)?
source
share