Skip to content

Instantly share code, notes, and snippets.

@Plastix
Created January 6, 2017 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Plastix/4cb59bfba91836b530b81379e8ba73aa to your computer and use it in GitHub Desktop.
Save Plastix/4cb59bfba91836b530b81379e8ba73aa to your computer and use it in GitHub Desktop.
Pair recursive functions in Scheme
(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