Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro do1 [expr1 & exprs]
- "Evaluates expr1 and then exprs and returns the value of expr1.
- Similar to Common Lisp's prog1."
- `(let [first-form-val# ~first-form]
- (do ~@forms) first-form-val#))
- (defn make-counter [init]
- (let [count (atom init)]
- (fn [n] (do1 @count (swap! count + n)))))
Add Comment
Please, Sign In to add comment