diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index 38c58daf16..f44fce09d9 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -128,17 +128,6 @@ :doc "Return true if x implements IPersistentVector "} vector? (fn vector? [x] (instance? clojure.lang.IPersistentVector x))) -(def - #^{:private true} - sigs - (fn [fdecl] - (if (seq? (first fdecl)) - (loop [ret [] fdecl fdecl] - (if fdecl - (recur (conj ret (first (first fdecl))) (next fdecl)) - (seq ret))) - (list (first fdecl))))) - (def #^{:arglists '([map key val] [map key val & kvs]) :doc "assoc[iate]. When applied to a map, returns a new map of the @@ -169,6 +158,27 @@ with-meta (fn with-meta [#^clojure.lang.IObj x m] (. x (withMeta m)))) +(def + #^{:private true} + sigs + (fn [fdecl] + (let [asig + (fn [fdecl] + (let [arglist (first fdecl) + body (next fdecl)] + (if (map? (first body)) + (if (next body) + (with-meta arglist (conj (if (meta arglist) (meta arglist) {}) (first body))) + arglist) + arglist)))] + (if (seq? (first fdecl)) + (loop [ret [] fdecls fdecl] + (if fdecls + (recur (conj ret (asig (first fdecls))) (next fdecls)) + (seq ret))) + (list (asig fdecl)))))) + + (def #^{:arglists '([coll]) :doc "Return the last item in coll, in linear time"}