Permalink
Browse files

Add docstring and :added metadata to definterface.

Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information...
1 parent a34e8f4 commit 4784f4c5397d26f47df5c0b37ede6576ca1023c2 @tsdh tsdh committed with stuarthalloway Oct 20, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/clj/clojure/core_deftype.clj
@@ -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]]]

0 comments on commit 4784f4c

Please sign in to comment.