diff options
author | Rich Hickey <richhickey@gmail.com> | 2009-11-24 07:51:02 -0500 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2009-11-24 07:51:02 -0500 |
commit | 4d08439a9cf79f34a730714f12edd5959aae126e (patch) | |
tree | c4bf543bd53832cf17a35c786705c14147c3b41a /src/clj | |
parent | 98366f353463afdc195b9b8fdf9d220bca7d0d6a (diff) |
direct linking of var calls, inlining of self calls
Granularity and control options for these still TBD, right now all of clojure* is direct linked, and contrib.mock known failing
Diffstat (limited to 'src/clj')
-rw-r--r-- | src/clj/clojure/core.clj | 26 | ||||
-rw-r--r-- | src/clj/clojure/test.clj | 3 |
2 files changed, 14 insertions, 15 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index 6f96e1e1..1cd7b167 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -227,7 +227,8 @@ fdecl) m (conj {:arglists (list 'quote (sigs fdecl))} m)] (list 'def (with-meta name (conj (if (meta name) (meta name) {}) m)) - (cons `fn fdecl))))) + (cons `fn (cons name fdecl)))))) + ;(cons `fn fdecl))))) (. (var defn) (setMacro)) @@ -427,8 +428,6 @@ [obj f & args] (with-meta obj (apply f (meta obj) args))) - - (defmacro lazy-seq "Takes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq @@ -489,8 +488,6 @@ (cat (concat x y) zs)))) ;;;;;;;;;;;;;;;;at this point all the support for syntax-quote exists;;;;;;;;;;;;;;;;;;;;;; - - (defmacro delay "Takes a body of expressions and yields a Delay object that will invoke the body only the first time it is forced (with force), and @@ -1908,6 +1905,10 @@ (next vs)) map))) +(defmacro declare + "defs the supplied var names with no bindings, useful for making forward declarations." + [& names] `(do ~@(map #(list 'def (vary-meta % assoc :declared true)) names))) + (defn line-seq "Returns the lines of text from rdr as a lazy sequence of strings. rdr must implement java.io.BufferedReader." @@ -2289,6 +2290,7 @@ of *out*. Prints the object(s), separated by spaces if there is more than one. By default, pr and prn print in a way that objects can be read by the reader" + {:dynamic true} ([] nil) ([x] (pr-on x *out*)) @@ -2886,7 +2888,7 @@ (let [name (if (symbol? (first sigs)) (first sigs) nil) sigs (if name (next sigs) sigs) sigs (if (vector? (first sigs)) (list sigs) sigs) - psig (fn [sig] + psig (fn* [sig] (let [[params & body] sig conds (when (and (next body) (map? (first body))) (first body)) @@ -2898,11 +2900,11 @@ `((let [~'% ~(if (< 1 (count body)) `(do ~@body) (first body))] - ~@(map (fn [c] `(assert ~c)) post) + ~@(map (fn* [c] `(assert ~c)) post) ~'%)) body) body (if pre - (concat (map (fn [c] `(assert ~c)) pre) + (concat (map (fn* [c] `(assert ~c)) pre) body) body)] (if (every? symbol? params) @@ -3780,7 +3782,7 @@ [fmt & args] (print (apply format fmt args))) -(def gen-class) +(declare gen-class) (defmacro with-loading-context [& body] `((fn loading# [] @@ -3912,7 +3914,7 @@ (let [d (root-resource lib)] (subs d 0 (.lastIndexOf d "/")))) -(def load) +(declare load) (defn- load-one "Loads a lib given its name. If need-ns, ensures that the associated @@ -4187,10 +4189,6 @@ #^{:doc "bound in a repl thread to the most recent exception caught by the repl"} *e) -(defmacro declare - "defs the supplied var names with no bindings, useful for making forward declarations." - [& names] `(do ~@(map #(list 'def %) names))) - (defn trampoline "trampoline can be used to convert algorithms requiring mutual recursion without stack consumption. Calls f with supplied args, if diff --git a/src/clj/clojure/test.clj b/src/clj/clojure/test.clj index 0d7c4600..5e432899 100644 --- a/src/clj/clojure/test.clj +++ b/src/clj/clojure/test.clj @@ -544,7 +544,8 @@ Chas Emerick, Allen Rohner, and Stuart Halloway", 'is' call 'report' to indicate results. The argument given to 'report' will be a map with a :type key. See the documentation at the top of test_is.clj for more information on the types of - arguments for 'report'."} + arguments for 'report'." + :dynamic true} report :type) (defmethod report :default [m] |