Advertisement
Guest User

Untitled

a guest
May 1st, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. (def x (atom 0))
  2.  
  3. t1: (future interval) where interval is an infinite loop that (swap! x random_number) after 1 second
  4. t2: (future computation) where computation is (factorial x), but computation should only succeed if x didn't change before factorial is done
  5.  
  6. (def computation (swap! x (fn [oldx] (factorial x) oldx))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement