Skip to content

Instantly share code, notes, and snippets.

@richhickey
Created April 23, 2010 19:27
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 richhickey/377040 to your computer and use it in GitHub Desktop.
Save richhickey/377040 to your computer and use it in GitHub Desktop.
(definterface ITak
(#^int tak [#^int x #^int y #^int z]))
(deftype Tak []
ITak
(tak [this x y z]
(if (>= y x)
z
(recur (.tak this (dec x) y z)
(.tak this (dec y) z x)
(.tak this (dec z) x y)))))
(.tak (Tak.) 24 16 8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment