Skip to content

Instantly share code, notes, and snippets.

@yokolet
Created March 30, 2014 02:10
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 yokolet/9866286 to your computer and use it in GitHub Desktop.
Save yokolet/9866286 to your computer and use it in GitHub Desktop.
Recursive call functions used from trampoline - for ClojureBridge CommunityDocs
(declare incrementor2 decrementor2)
(defn incrementor2 [n]
(let [_ (print (str n ", "))
next-val (+ n (rand-int 100))]
(if (< -10000 next-val)
#(decrementor2 next-val))))
(defn decrementor2 [n]
(let [_ (print (str n ", "))
next-val (- n (rand-int 100))]
(if (> 10000 next-val)
#(incrementor2 next-val))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment