I have a problem with this example
(define (+ xy) (if (= x 0) y (+ (-1+ x) (1+ y))))
What is the problem with -1 + and 1+, when I evaluate it, I get this result
- DrScheme: -1+: this function is not defined
- racket: id reference undefined: -1 +
but i write this instead and it works
(define (add xy) (if (= x 0) y (+ (- x 1) (+ y 1))))
source share