Skip to content

Instantly share code, notes, and snippets.

@sritchie
Created March 31, 2011 05:14
Show Gist options
  • Select an option

  • Save sritchie/895855 to your computer and use it in GitHub Desktop.

Select an option

Save sritchie/895855 to your computer and use it in GitHub Desktop.
(defmacro phase-fn
([argvec] `(phase-fn ~argvec identity))
([argvec func & more]
`(fn [session# ~@argvec]
(-> session#
~(if (seq more)
`(phase-fn ~argvec ~@more)
`(check-session (str "The session passed into " '~func)))
~func))))
;; Why am I getting this sequence after fn?
(fn* ([session__26526__auto__ x]
(clojure.core/-> session__26526__auto__
(pallet.crate.hadoop/phase-fn [x] (+ 1 2))
(+ 2 x))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment