Skip to content

Commit

Permalink
Add docstring and :added metadata to definterface.
Browse files Browse the repository at this point in the history
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information
tsdh authored and stuarthalloway committed Oct 20, 2012
1 parent a34e8f4 commit 4784f4c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/clj/clojure/core_deftype.clj
Expand Up @@ -36,7 +36,15 @@ ditto for method impls defined with deftype, defrecord, and reify."))))
"No varargs nor destructuring support for definterface and defprotocol method sigs."))))

;for now, built on gen-interface
(defmacro definterface
(defmacro definterface
"Creates a new Java interface with the given name and method sigs.
The method return types and parameter types may be specified with type hints,
defaulting to Object if omitted.
(definterface MyInterface
(^int method1 [x])
(^Bar method2 [^Baz b ^Quux q]))"
{:added "1.2"} ;; Present since 1.2, but made public in 1.5.
[name & sigs]
(let [tag (fn [x] (or (:tag (meta x)) Object))
psig (fn [[name [& args]]]
Expand Down

0 comments on commit 4784f4c

Please sign in to comment.