Speck: concise inline function specs

Tagged literals work at read time - basically, they have no knowledge about which symbols resolve to which vars and stuff like that; they just take a datastructure, apply a function to it and return the new datastructure back. So in #|[foo bar], the argument is simply a list of two symbols, similar to '[foo bar] - it doesn’t matter what they resolve to (and if they resolve at all).

I’ve just pushed [speck "0.0.2-SNAPSHOT"] to clojars, so if you want you can try it out (I’ve updated the gist too):

(ns user
  (:require [speck.v0.core :as speck :refer [| =>]]
            [orchestra.spec.test :as orchestra]))

;; add the tag:
(set! *data-readers* (assoc *data-readers* '| #'speck-reader))

;; if you're not in cider, you might need to do this instead:
(alter-var-root #'*data-readers* assoc '| #'speck-reader)

;; voilà!
(defn single-clause
  #|[number? => odd?]
  [x] (inc x))

(speck/gen-spec single-clause)
(orchestra/instrument `[single-clause])

(ugh, is there any way to prevent it from inserting a huge preview thing when I paste a link to gist?)