(define (even-odd x)
(if ( ==(% x 2 ) 0) (1) (0)))
when i call( even-odd 5 )
i get this message
;Unbound variable: %
;To continue, call RESTART with an option number:
; (RESTART 11) => Specify a value to use instead of %.
; (RESTART 10) => Define % to a given value.
; (RESTART 9) => Return to read-eval-print level 9.
; (RESTART 8) => Return to read-eval-print level 8.
; (RESTART 7) => Return to read-eval-print level 7.
; (RESTART 6) => Return to read-eval-print level 6.
; (RESTART 5) => Return to read-eval-print level 5.
; (RESTART 4) => Return to read-eval-print level 4.
; (RESTART 3) => Return to read-eval-print level 3.
; (RESTART 2) => Return to read-eval-print level 2.
; (RESTART 1) => Return to read-eval-print level 1.
;Start debugger? (y or n):
Am i doing something wrong ?Also let me know how to select text in edwin.
You have a few problems here; namely that you’re mistaken in the names of the procedures you’re trying to call.
%should bemodulo==should beeqv?or, if you’re simply trying to tell whether a number is even or odd, a simpler and cleaner way to do this is to simply use the builtin
even?.or if you actually want 0 and 1 as a result, a cleaner expression could be