Created
January 6, 2017 01:48
-
-
Save Plastix/4cb59bfba91836b530b81379e8ba73aa to your computer and use it in GitHub Desktop.
Pair recursive functions in Scheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define odd? | |
(lambda (n) | |
(cond | |
[(zero? n) #f] | |
[else (even? (- n 1))]))) | |
(define even? | |
(lambda (n) | |
(cond | |
[(zero? n) #t] | |
[else (odd? (- n 1))]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment