def-clj
![](https://camo.githubusercontent.com/19315246182f0a9fc7563b9fc67bb9beed8db433576b4d0037fd3f8931fad781/68747470733a2f2f7777772e6f686c6f682e6e65742f702f6465662d636c6a2f776964676574732f70726f6a6563745f7468696e5f62616467652e676966)
Clojure helper functions for function definitions.
Usage
The namespace com.github.sebhoss.def
offers the following functions:
(defnk name decls)
Defines a keyword-based function(defn* name decls)
Defines both Clojure and Java functions (using the standard prefix -). Usefull for Java interoperability.
Example
defnk
(require '[com.github.sebhoss.def :refer :all])
(defnk my-func [:key1 :key2 :key3] ...) ; expandes to: (defn my-func [& {:keys [key1 key2 key3]}] ...)
defn*
(require '[com.github.sebhoss.def :refer :all])
(defn* my-func [params] ...) ; expandes to (defn my-func [params] ...) and (defn -myFunc [params] ...)
Integration
Maven
<dependencies>
<dependency>
<groupId>com.github.sebhoss</groupId>
<artifactId>def-clj</artifactId>
<version>[1.0.0,2.0.0)</version>
</dependency>
</dependencies>
Leiningen
[com.github.sebhoss/def-clj "[1.0.0,2.0.0)"]
License
This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.