Skip to content

Instantly share code, notes, and snippets.

@tmathmeyer
Created December 27, 2014 08:05
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 tmathmeyer/5d4789de025ad2a163a8 to your computer and use it in GitHub Desktop.
Save tmathmeyer/5d4789de025ad2a163a8 to your computer and use it in GitHub Desktop.
(#def pow (x y)
(if (= 0 y) 1
(if (= y 1) x
(* x (pow x (- y 1))))))
(print (pow 3 4))
(#def begin (x y) y)
(#def mut1 (x)
(begin (print x)
(mut2 (+ x 1))))
(#def mut2 (x)
(if (= 0 x) 0 (mut1 (- x 2))))
(mut2 (pow 4 4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment