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 70737073 ([arg1] ...)
70747074 ([arg1 & others] ...))"
70757075 [class-and-interfaces args & fs]
7076- (let [formatted-arity (fn [method-name [arg-vec & body]]
7076+ (let [formatted-single (fn [method-name [arg-vec & body]]
7077+ [(munge method-name)
7078+ (apply list 'fn method-name (vec (concat ['this] arg-vec)) body)])
7079+ formatted-multi (fn [method-name & arities]
70777080 [(munge method-name)
7078- (apply list 'fn method-name (vec (concat ['this] arg-vec)) body)])
7079- methods (mapcat (fn [[method-name & body]]
7080- (if (vector? (first body))
7081- (formatted-arity method-name body)
7082- (mapcat (partial formatted-arity method-name) body)))
7083- fs)]
7081+ (apply list
7082+ 'fn
7083+ method-name
7084+ (map (fn [[arg-vec & body]]
7085+ (apply list (vec (concat ['this] arg-vec)) body))
7086+ arities))])
7087+ methods (mapcat (fn [[method-name & body]]
7088+ (if (vector? (first body))
7089+ (formatted-single method-name body)
7090+ (apply formatted-multi method-name body)))
7091+ fs)]
70847092 #_(println methods)
70857093 `((get-proxy-class ~@class-and-interfaces) ~(apply hash-map methods) ~@args)))
70867094
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