Advertisement
Guest User

quotes

a guest
Oct 9th, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defmacro binding-test
  2.   [test body & remainder]
  3.   `(let [~'testVar ~test ~'bodyVar ~body] ~@remainder))
  4.  
  5. (defmacro do-while
  6.   [test & body]
  7.   (binding-test test body
  8.     (quote
  9.       loop []
  10.       bodyVar
  11.       (when testVar
  12.         (recur)))))
  13.  
  14. (def y 4)
  15. (do-while (> y 0)
  16.   (println y)
  17.   (def y (dec y)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement