Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boot.user=> (defn and->> [f value] (doto value f))
- #'boot.user/and->>
- boot.user=> (defn and-> [value f] (doto value f))
- #'boot.user/and->
- ;; use the appropriate and->(>) form for your threading macro
- boot.user=> (-> 1 (and-> println))
- 1
- 1
- ;; or ignore the value passed in
- boot.user=> (->> 1 (and->> (fn [_] (println "hello"))))
- hello
- 1
- boot.user=> (-> 1 (and-> (fn [_] (println "hello"))))
- hello
- 1
- ;; or perhaps using `constantly`?
- (-> 1 (and-> (constantly (println "hello")))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement