File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 71227122 ([arg1] ...)
71237123 ([arg1 & others] ...))"
71247124 [class-and-interfaces args & fs]
7125- (let [formatted-arity (fn [method-name [arg-vec & body]]
7125+ (let [formatted-single (fn [method-name [arg-vec & body]]
7126+ [(munge method-name)
7127+ (apply list 'fn method-name (vec (concat ['this] arg-vec)) body)])
7128+ formatted-multi (fn [method-name & arities]
71267129 [(munge method-name)
7127- (apply list 'fn method-name (vec (concat ['this] arg-vec)) body)])
7128- methods (mapcat (fn [[method-name & body]]
7129- (if (vector? (first body))
7130- (formatted-arity method-name body)
7131- (mapcat (partial formatted-arity method-name) body)))
7132- fs)]
7130+ (apply list
7131+ 'fn
7132+ method-name
7133+ (map (fn [[arg-vec & body]]
7134+ (apply list (vec (concat ['this] arg-vec)) body))
7135+ arities))])
7136+ methods (mapcat (fn [[method-name & body]]
7137+ (if (vector? (first body))
7138+ (formatted-single method-name body)
7139+ (apply formatted-multi method-name body)))
7140+ fs)]
71337141 #_(println methods)
71347142 `((get-proxy-class ~@class-and-interfaces) ~(apply hash-map methods) ~@args)))
71357143
Original file line number Diff line number Diff line change 4141 ([arg1 & args] (str "i am rest " arg1 " " args))))]
4242 (is (= "hi i am 0" (.to-string p)))
4343 (is (= "i am 1 yes" (.to-string p "yes")))
44- (is (= "i am rest first " (.to-string p "first")))
4544 (is (= "i am rest first (:yes)" (.to-string p "first" :yes))))))
You can’t perform that action at this time.
0 commit comments