(<err-> x & forms)
Each of the forms should yield a tuple [err result] wrapped in an async-channel. As long as err is nil, result is passed onto the next form as the first argument. As soon as an err is not nil (or there are no more forms), the tuple is returned.
Example: (go (let [[err result] (<! (<err-> {:url "some-url"} (connect {:keep-alive 10}) (do-query {:some :selector})))] (if err (println "Something went wrong:" err) (println "Query result:" result))))
Each of the forms should yield a tuple [err result] wrapped in an async-channel. As long as err is nil, result is passed onto the next form as the first argument. As soon as an err is not nil (or there are no more forms), the tuple is returned. Example: (go (let [[err result] (<! (<err-> {:url "some-url"} (connect {:keep-alive 10}) (do-query {:some :selector})))] (if err (println "Something went wrong:" err) (println "Query result:" result))))
(<err->> x & forms)
Each of the forms should yield a tuple [err result] wrapped in an async-channel. As long as err is nil, result is passed onto the next form as the last argument. As soon as err is not nil (or there are no more forms), the tuple is returned.
Example: (go (let [[err result] (<! (<err->> connect-opts (connect client)))] (if err (println "Something went wrong:" err) (println "Connect result:" result))))
Each of the forms should yield a tuple [err result] wrapped in an async-channel. As long as err is nil, result is passed onto the next form as the last argument. As soon as err is not nil (or there are no more forms), the tuple is returned. Example: (go (let [[err result] (<! (<err->> connect-opts (connect client)))] (if err (println "Something went wrong:" err) (println "Connect result:" result))))
(err-> x & forms)
Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc.
Each form should return a tuple, where the left value is either nil or an error, and the right value is a correct result. Threading stops as soon as a form returns an error.
Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc. Each form should return a tuple, where the left value is either nil or an error, and the right value is a correct result. Threading stops as soon as a form returns an error.
(err->> x & forms)
Threads the expr through the forms. Inserts x as the last item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc.
Each form should return a tuple, where the left value is either nil or an error, and the right value is a correct result. Threading stops as soon as a form returns an error.
Threads the expr through the forms. Inserts x as the last item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc. Each form should return a tuple, where the left value is either nil or an error, and the right value is a correct result. Threading stops as soon as a form returns an error.
(in? coll elm)
true if elm is in coll. (in? '(1 2 3) 1) ;; => true (in? '(1 2 3) 4) ;; => false
true if elm is in coll. (in? '(1 2 3) 1) ;; => true (in? '(1 2 3) 4) ;; => false
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close