aboutsummaryrefslogtreecommitdiff
path: root/clojurescript/avoid-java-in-boot.patch
diff options
context:
space:
mode:
authorChouser <chouser@n01se.net>2008-10-15 05:23:21 +0000
committerChouser <chouser@n01se.net>2008-10-15 05:23:21 +0000
commit5e53e7aca850e8937bdbf0f0194371c50fa36258 (patch)
treea6f7f45d142e7693144549c31be2f7c16db73bcb /clojurescript/avoid-java-in-boot.patch
parent7d343ae94fc925d2a37bae02978d0ec04f409d4e (diff)
ClojureScript: update for Clojure SVN 1067, plus other bug fixes.
Diffstat (limited to 'clojurescript/avoid-java-in-boot.patch')
-rw-r--r--clojurescript/avoid-java-in-boot.patch76
1 files changed, 49 insertions, 27 deletions
diff --git a/clojurescript/avoid-java-in-boot.patch b/clojurescript/avoid-java-in-boot.patch
index f9deb0f7..8540b3a6 100644
--- a/clojurescript/avoid-java-in-boot.patch
+++ b/clojurescript/avoid-java-in-boot.patch
@@ -1,5 +1,5 @@
diff --git a/src/clj/clojure/boot.clj b/src/clj/clojure/boot.clj
-index 40c90a0..99caeba 100644
+index 7d8ae02..9327de5 100644
--- a/src/clj/clojure/boot.clj
+++ b/src/clj/clojure/boot.clj
@@ -315,7 +315,7 @@
@@ -29,7 +29,7 @@ index 40c90a0..99caeba 100644
([x y] (. clojure.lang.Numbers (multiply x y)))
([x y & more]
(reduce * (* x y) more)))
-@@ -1031,7 +1031,7 @@
+@@ -1032,7 +1032,7 @@
([state] (new clojure.lang.Agent state))
([state validate-fn] (new clojure.lang.Agent state validate-fn)))
@@ -38,7 +38,7 @@ index 40c90a0..99caeba 100644
(defn send
"Dispatch an action to an agent. Returns the agent immediately.
-@@ -1343,10 +1343,10 @@
+@@ -1344,10 +1344,10 @@
(defn range
"Returns a lazy seq of nums from start (inclusive) to end
(exclusive), by step, where start defaults to 0 and step to 1."
@@ -51,7 +51,7 @@ index 40c90a0..99caeba 100644
(new clojure.lang.Range start end)
(take (- end start) (iterate inc start))))
([start end step]
-@@ -1410,7 +1410,7 @@
+@@ -1411,7 +1411,7 @@
([#^java.util.Comparator comp coll]
(when (and coll (not (zero? (count coll))))
(let [a (to-array coll)]
@@ -60,7 +60,7 @@ index 40c90a0..99caeba 100644
(seq a)))))
(defn sort-by
-@@ -1440,8 +1440,8 @@
+@@ -1441,8 +1441,8 @@
~@body)
(recur (rest list#)))))
@@ -71,7 +71,7 @@ index 40c90a0..99caeba 100644
(defn dorun
"When lazy sequences are produced via functions that have side
-@@ -1476,7 +1476,7 @@
+@@ -1477,7 +1477,7 @@
occurred."
[& agents]
(when *agent*
@@ -80,7 +80,7 @@ index 40c90a0..99caeba 100644
(let [latch (new java.util.concurrent.CountDownLatch (count agents))
count-down (fn [agent] (. latch (countDown)) agent)]
(doseq agent agents
-@@ -1495,7 +1495,7 @@
+@@ -1496,7 +1496,7 @@
to timeout, non-nil otherwise."
[timeout-ms & agents]
(when *agent*
@@ -89,7 +89,7 @@ index 40c90a0..99caeba 100644
(let [latch (new java.util.concurrent.CountDownLatch (count agents))
count-down (fn [agent] (. latch (countDown)) agent)]
(doseq agent agents
-@@ -1527,6 +1527,8 @@
+@@ -1528,6 +1528,8 @@
(. ns (importClass c (. Class (forName (str pkg "." c)))))) )
(apply import (rest import-lists))))
@@ -98,7 +98,7 @@ index 40c90a0..99caeba 100644
(defn into-array
"Returns an array of the type of the first element in coll,
containing the contents of coll, which must be of a compatible
-@@ -1741,7 +1743,7 @@
+@@ -1742,7 +1744,7 @@
{:inline (fn [a i] `(. clojure.lang.RT (aget ~a ~i)))
:inline-arities #{2}}
([array idx]
@@ -107,7 +107,7 @@ index 40c90a0..99caeba 100644
([array idx & idxs]
(apply aget (aget array idx) idxs)))
-@@ -1751,7 +1753,7 @@
+@@ -1752,7 +1754,7 @@
{:inline (fn [a i v] `(. clojure.lang.RT (aset ~a ~i ~v)))
:inline-arities #{3}}
([array idx val]
@@ -116,7 +116,7 @@ index 40c90a0..99caeba 100644
val)
([array idx idx2 & idxv]
(apply aset (aget array idx) idx2 idxv)))
-@@ -1919,6 +1921,10 @@
+@@ -1920,6 +1922,10 @@
"Returns a set of the distinct elements of coll."
[coll] (apply hash-set coll))
@@ -127,7 +127,7 @@ index 40c90a0..99caeba 100644
(defn #^{:private true}
filter-key [keyfn pred amap]
(loop [ret {} es (seq amap)]
-@@ -1951,7 +1957,7 @@
+@@ -1952,7 +1958,7 @@
the-ns [x]
(if (instance? clojure.lang.Namespace x)
x
@@ -136,7 +136,7 @@ index 40c90a0..99caeba 100644
(defn ns-name
"Returns the name of the namespace, a symbol."
-@@ -1984,7 +1990,7 @@
+@@ -1985,7 +1991,7 @@
(defn ns-imports
"Returns a map of the import mappings for the namespace."
[ns]
@@ -145,7 +145,7 @@ index 40c90a0..99caeba 100644
(defn refer
"refers to all public vars of ns, subject to filters.
-@@ -2002,7 +2008,8 @@
+@@ -2003,7 +2009,8 @@
to a symbol different from the var's name, in order to prevent
clashes. Use :use in the ns macro in preference to calling this directly."
[ns-sym & filters]
@@ -155,7 +155,7 @@ index 40c90a0..99caeba 100644
fs (apply hash-map filters)
nspublics (ns-publics ns)
rename (or (:rename fs) {})
-@@ -2138,7 +2145,7 @@
+@@ -2139,7 +2146,7 @@
true)
(= firstb :as) (pb ret (second bs) gvec)
:else (if seen-rest?
@@ -164,7 +164,7 @@ index 40c90a0..99caeba 100644
(recur (pb ret firstb (list `nth gvec n nil))
(inc n)
(rest bs)
-@@ -2169,7 +2176,7 @@
+@@ -2170,7 +2177,7 @@
(symbol? b) (-> bvec (conj b) (conj v))
(vector? b) (pvec bvec b v)
(map? b) (pmap bvec b v)
@@ -173,7 +173,7 @@ index 40c90a0..99caeba 100644
process-entry (fn [bvec b] (pb bvec (key b) (val b)))]
(if (every? symbol? (keys bmap))
bindings
-@@ -2310,7 +2317,7 @@
+@@ -2311,7 +2318,7 @@
StringWriter. Returns the string created by any nested printing
calls."
[& body]
@@ -182,7 +182,7 @@ index 40c90a0..99caeba 100644
(binding [*out* s#]
~@body
(str s#))))
-@@ -2356,7 +2363,7 @@
+@@ -2357,7 +2364,7 @@
logical true."
[x]
`(when-not ~x
@@ -191,7 +191,7 @@ index 40c90a0..99caeba 100644
(defn test
"test [v] finds fn at key :test in var metadata and calls it,
-@@ -2428,7 +2435,7 @@
+@@ -2429,7 +2436,7 @@
(defn rand
"Returns a random floating point number between 0 (inclusive) and
1 (exclusive)."
@@ -200,7 +200,7 @@ index 40c90a0..99caeba 100644
([n] (* n (rand))))
(defn rand-int
-@@ -2538,7 +2545,7 @@
+@@ -2539,7 +2546,7 @@
"Reads the file named by f into a string and returns it."
[#^String f]
(with-open r (new java.io.BufferedReader (new java.io.FileReader f))
@@ -209,7 +209,7 @@ index 40c90a0..99caeba 100644
(loop [c (. r (read))]
(if (neg? c)
(str sb)
-@@ -2822,10 +2829,6 @@
+@@ -2823,10 +2830,6 @@
(send-off agt fill)
(drain))))
@@ -220,7 +220,7 @@ index 40c90a0..99caeba 100644
(defn alter-var-root
"Atomically alters the root binding of var v by applying f to its
current value plus any args"
-@@ -2910,7 +2913,7 @@
+@@ -2912,7 +2915,7 @@
relationships."
([tag] (descendants global-hierarchy tag))
([h tag] (if (class? tag)
@@ -229,7 +229,7 @@ index 40c90a0..99caeba 100644
(not-empty (get (:descendants h) tag)))))
(defn derive
-@@ -2937,9 +2940,9 @@
+@@ -2939,9 +2942,9 @@
(or
(when-not (contains? (tp tag) parent)
(when (contains? (ta tag) parent)
@@ -241,7 +241,7 @@ index 40c90a0..99caeba 100644
{:parents (assoc (:parents h) tag (conj (get tp tag #{}) parent))
:ancestors (tf (:ancestors h) tag td parent ta)
:descendants (tf (:descendants h) parent ta tag td)})
-@@ -3066,7 +3069,7 @@
+@@ -3068,7 +3071,7 @@
[pred fmt & args]
(when pred
(let [message (apply format fmt args)
@@ -250,8 +250,26 @@ index 40c90a0..99caeba 100644
raw-trace (.getStackTrace exception)
boring? #(not= (.getMethodName %) "doInvoke")
trace (into-array (drop 2 (drop-while boring? raw-trace)))]
+@@ -3428,7 +3431,7 @@
+
+ (defn print-ctor [o print-args #^Writer w]
+ (.write w "#=(")
+- (.write w (.getName (class o)))
++ (.write w (RT/className (class o)))
+ (.write w ". ")
+ (print-args o w)
+ (.write w ")"))
+@@ -3557,7 +3560,7 @@
+
+ (defmethod print-method Class [#^Class c, #^Writer w]
+ (.write w "#=")
+- (.write w (.getName c)))
++ (.write w (RT/className c)))
+
+ (defmethod print-method java.math.BigDecimal [b, #^Writer w]
+ (.write w (str b))
diff --git a/src/jvm/clojure/lang/RT.java b/src/jvm/clojure/lang/RT.java
-index 0a891bf..a1fafb7 100644
+index 9982ebb..4927d30 100644
--- a/src/jvm/clojure/lang/RT.java
+++ b/src/jvm/clojure/lang/RT.java
@@ -30,6 +30,8 @@ public class RT{
@@ -263,7 +281,7 @@ index 0a891bf..a1fafb7 100644
//simple-symbol->class
final static IPersistentMap DEFAULT_IMPORTS = map(
// Symbol.create("RT"), "clojure.lang.RT",
-@@ -959,6 +961,10 @@ static public double doubleCast(double x){
+@@ -963,6 +965,10 @@ static public double doubleCast(double x){
return x;
}
@@ -274,7 +292,7 @@ index 0a891bf..a1fafb7 100644
static public IPersistentMap map(Object... init){
if(init != null && init.length == 2)
return new PersistentArrayMap(init);
-@@ -1644,4 +1650,35 @@ static public int alength(Object xs){
+@@ -1676,4 +1682,39 @@ static public int alength(Object xs){
return Array.getLength(xs);
}
@@ -309,4 +327,8 @@ index 0a891bf..a1fafb7 100644
+ return Math.random();
+}
+
++static public String className(Class c){
++ return c.getName();
++}
++
}