Skip to content

Instantly share code, notes, and snippets.

@noidi
noidi / code.clj
Last active August 29, 2015 14:05 — forked from krisajenkins/code.clj
;;; Changes:
;;; - Annotate the parameter of the lambda given to filter. This was the cause of the error.
;;; - Change the last parameter of lookup-by from Seq to Seqable to allow it to work with vectors.
;;; - Replace (IFn [a -> b]) with [a -> b]. They're equivalent.
(t/ann lookup-by (t/All [a b]
[b [a -> b] (t/Option (t/Seqable a)) -> (t/Option a)]))
(defn lookup-by
"Convenience filter. Returns the first item in coll where (= value (lookup-fn item))"
@noidi
noidi / gist:3088247
Created July 11, 2012 05:53 — forked from sjl/gist:3088120
wat
git clone git://github.com/sjl/caves/
cd caves

Start a REPL:

lein repl

It'll grab the deps and start fine. Cool. Close out of it.

Now edit the name of one of the methods in a protocol (and all the things that use it, of course):