Guest User

dosync-once

a guest
Feb 22nd, 2012
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defmacro dosync-once [& exprs]
  2.   `(let [retried# (atom false)]
  3.      (dosync
  4.        (swap! retried# (constantly true))
  5.        (when @retried# (throw ...))
  6.        ~@exprs)))
Advertisement
Add Comment
Please, Sign In to add comment