Skip to content

Instantly share code, notes, and snippets.

@KirinDave
Created July 16, 2009 06:21
Show Gist options
  • Select an option

  • Save KirinDave/148255 to your computer and use it in GitHub Desktop.

Select an option

Save KirinDave/148255 to your computer and use it in GitHub Desktop.
#lang scheme
(letrec ([recur1
(lambda (x)
(cond
[(< x 0) (display "Countdown complete.")]
[else (printf "Counting ~s~n" x)
(recur2 (- x 1))]))]
[recur2
(lambda (x)
(cond
[(even? x) (printf "I saw an even number.~n") (recur1 x)]
[(odd? x) (printf "I saw an odd number.~n") (recur1 x)]))])
(recur2 10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment