Skip to content

Instantly share code, notes, and snippets.

View currymj's full-sized avatar

Michael J. Curry currymj

View GitHub Profile
(defrecord LSH [X b w]
clojure.lang.IFn
(invoke [this v]
(a/floor (a/div (a/add b (a/inner-product X v))
w)))
(applyTo [this args] (clojure.lang.AFn/applyToHelper this args)))
@currymj
currymj / parse.jl
Created March 8, 2015 20:57
lisp parser for hacker school interview
module SEXPParser
# patterns for identifiers, and both kinds of numbers
#const ident = r"[[:punct:][:alpha:]][[:alnum:]]*"
const integer = r"^-*\d+$"
const floating = r"^-*\d*\.\d+$"
# converts numbers to their proper forms, and could
# be extended