coltnz / defm

A small Clojure library designed to provide a simple pattern matching defn-like construct called defm.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

defm

A Clojure library designed to provide a simple pattern matching defn-like construct called defm.

Defm dispatches on parameter type and value as well as number of parameters

Usage

(defm file-or-string-fn []
  ([File] (println "It's a file"))
  ([s :- String] (println "It's a string " s))
  (["magic"] (println "It's magic"))
  ([_] (println "It's a " (type _1))))

License

Copyright © 2014 Colin Taylor

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

A small Clojure library designed to provide a simple pattern matching defn-like construct called defm.

License:Eclipse Public License 1.0


Languages

Language:Clojure 100.0%