Skip to content

Instantly share code, notes, and snippets.

@AlexBaranosky
Created December 13, 2011 03:09
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 AlexBaranosky/1470342 to your computer and use it in GitHub Desktop.
Save AlexBaranosky/1470342 to your computer and use it in GitHub Desktop.
;; I want to replace this:
(defn- unfinished* [names]
(let [declarations (for [name names]
`(do
(defn ~name [& args#]
(throw (user-error (str "#'" '~name " has no implementation. It's used as a prerequisite in Midje tests."))))
;; A reliable way of determining if an `unfinished` function
;; has since been defined.
(alter-meta! (var ~name) assoc :midje/unfinished-fun ~name)))]
`(do ~@declarations)))
;; with this:
(defn- unfinished* [names]
(let [declarations (for [name names]
;; metadata's a reliable way of determining if an
;; `unfinished` function has since been defined.
`(defn ^{:midje/unfinished-fun ~name} ~name [& args#]
(throw (user-error (str "#'" '~name " has no implementation. It's used as a prerequisite in Midje tests.")))))]
`(do ~@declarations)))
;; doesn't seem to work. any suggestions?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment