Skip to content

Instantly share code, notes, and snippets.

@mpenet
Created April 24, 2012 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpenet/2479743 to your computer and use it in GitHub Desktop.
Save mpenet/2479743 to your computer and use it in GitHub Desktop.
lamina maybe pipeline (exits if any stage returns nil)
(defmacro maybe-pipeline [& opts+stages]
(let [[options stages] (split-options opts+stages (meta &form))]
`(pipeline ~@(concat options
(interpose #(if (nil? %)
(complete nil)
%)
stages)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment