Skip to content

Commit 9f8af67

Browse files
Merge branch 'clojure/master' into android
2 parents 6622ce9 + 05af4b5 commit 9f8af67

File tree

10 files changed

+339
-12
lines changed

10 files changed

+339
-12
lines changed

build.xml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
<property name="jtestsrc" location="${test}/java"/>
1212
<property name="cljsrc" location="${src}/clj"/>
1313
<property name="cljscript" location="${src}/script"/>
14-
<property name="test-script" location="${cljscript}/run_tests.clj"/>
14+
<property name="test-script" location="${cljscript}/run_test.clj"/>
15+
<property name="test-generative-script" location="${cljscript}/run_test_generative.clj"/>
1516
<property name="compile-script" location="${cljscript}/bootstrap_compile.clj"/>
1617
<property name="target" location="target"/>
1718
<property name="build" location="${target}/classes"/>
@@ -98,7 +99,7 @@
9899
</java>
99100
</target>
100101

101-
<target name="test"
102+
<target name="test-example"
102103
description="Run clojure tests without recompiling clojure."
103104
depends="compile-tests"
104105
unless="maven.test.skip">
@@ -114,6 +115,26 @@
114115
</java>
115116
</target>
116117

118+
<target name="test-generative"
119+
description="Run test generative tests without recompiling clojure."
120+
depends="compile-tests"
121+
unless="maven.test.skip">
122+
<java classname="clojure.main" failonerror="true" fork="true">
123+
<classpath>
124+
<pathelement path="${maven.test.classpath}"/>
125+
<path location="${test-classes}"/>
126+
<path location="${test}"/>
127+
<path location="${build}"/>
128+
<path location="${cljsrc}"/>
129+
</classpath>
130+
<arg value="${test-generative-script}"/>
131+
</java>
132+
</target>
133+
134+
<target name="test"
135+
description="Run all the tests"
136+
depends="test-example,test-generative"/>
137+
117138
<target name="build"
118139
description="Build Clojure (compilation only, no tests)."
119140
depends="compile-java, compile-clojure"/>

changes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Some related issues addressed during development:
6161
* [CLJ-1497](http://dev.clojure.org/jira/browse/CLJ-1497)
6262
* [CLJ-1549](http://dev.clojure.org/jira/browse/CLJ-1549)
6363
* [CLJ-1537](http://dev.clojure.org/jira/browse/CLJ-1537)
64+
* [CLJ-1554](http://dev.clojure.org/jira/browse/CLJ-1554)
65+
6466

6567
### 1.2 Keyword and Symbol Construction
6668

@@ -148,6 +150,8 @@ Example use:
148150
clojure.core/set should use transients for better performance
149151
* [CLJ-1429](http://dev.clojure.org/jira/browse/CLJ-1429)
150152
Cache unknown multimethod value default dispatch
153+
* [CLJ-1529](http://dev.clojure.org/jira/browse/CLJ-1529)
154+
Reduce compile times by avoiding unnecessary calls to Class.forName()
151155

152156
### 2.4 Other enhancements
153157

@@ -163,6 +167,8 @@ Example use:
163167
Don't initialize classes when importing them
164168
* [CLJ-1330](http://dev.clojure.org/jira/browse/CLJ-1330)
165169
Class name clash between top-level functions and defn'ed ones
170+
* [CLJ-1349](http://dev.clojure.org/jira/browse/CLJ-1349)
171+
Update to latest test.generative and add dependency on test.check
166172

167173
## 3 Bug Fixes
168174

@@ -188,6 +194,10 @@ Example use:
188194
Make cached string value of Keyword and Symbol transient
189195
* [CLJ-1466](http://dev.clojure.org/jira/browse/CLJ-1466)
190196
clojure.core/bean should implement Iterable
197+
* [CLJ-1578](http://dev.clojure.org/jira/browse/CLJ-1578)
198+
Make refer of Clojure core function not throw exception on reload
199+
* [CLJ-1501](http://dev.clojure.org/jira/browse/CLJ-1501)
200+
LazySeq equals() should not use equiv() logic
191201

192202
# Changes to Clojure in Version 1.6
193203

pom.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,19 @@
4747
<dependency>
4848
<groupId>org.clojure</groupId>
4949
<artifactId>test.generative</artifactId>
50-
<version>0.4.0</version>
50+
<version>0.5.1</version>
51+
<scope>test</scope>
52+
<exclusions>
53+
<exclusion>
54+
<groupId>org.clojure</groupId>
55+
<artifactId>clojure</artifactId>
56+
</exclusion>
57+
</exclusions>
58+
</dependency>
59+
<dependency>
60+
<groupId>org.clojure</groupId>
61+
<artifactId>test.check</artifactId>
62+
<version>0.5.9</version>
5163
<scope>test</scope>
5264
<exclusions>
5365
<exclusion>

src/jvm/clojure/lang/Compiler.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,8 @@ private static Class maybeClass(Object form, boolean stringOk) {
10031003
Object o = currentNS().getMapping(sym);
10041004
if(o instanceof Class)
10051005
c = (Class) o;
1006+
else if(LOCAL_ENV.deref() != null && ((java.util.Map)LOCAL_ENV.deref()).containsKey(form))
1007+
return null;
10061008
else
10071009
{
10081010
try{
@@ -1044,7 +1046,7 @@ else if(stringOk && form instanceof String)
10441046
}
10451047
*/
10461048
static Class tagToClass(Object tag) {
1047-
Class c = maybeClass(tag, true);
1049+
Class c = null;
10481050
if(tag instanceof Symbol)
10491051
{
10501052
Symbol sym = (Symbol) tag;
@@ -1086,6 +1088,8 @@ else if(sym.name.equals("boolean"))
10861088
c = Boolean.TYPE;
10871089
}
10881090
}
1091+
if(c == null)
1092+
c = maybeClass(tag, true);
10891093
if(c != null)
10901094
return c;
10911095
throw new IllegalArgumentException("Unable to resolve classname: " + tag);
@@ -3849,10 +3853,7 @@ static Expr parse(C context, ISeq form, String name) {
38493853

38503854
if(RT.second(form) instanceof Symbol) {
38513855
nm = (Symbol) RT.second(form);
3852-
if (name == null)
3853-
name = nm.name + "__" + RT.nextID();
3854-
else
3855-
name += "__" + nm.name + "__" + RT.nextID();
3856+
name = nm.name + "__" + RT.nextID();
38563857
} else {
38573858
if(name == null)
38583859
name = "fn__" + RT.nextID();

src/jvm/clojure/lang/LazySeq.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ public IPersistentCollection empty(){
9797
}
9898

9999
public boolean equiv(Object o){
100-
return equals(o);
100+
ISeq s = seq();
101+
if(s != null)
102+
return s.equiv(o);
103+
else
104+
return (o instanceof Sequential || o instanceof List) && RT.seq(o) == null;
101105
}
102106

103107
public int hashCode(){
@@ -114,7 +118,7 @@ public int hasheq(){
114118
public boolean equals(Object o){
115119
ISeq s = seq();
116120
if(s != null)
117-
return s.equiv(o);
121+
return s.equals(o);
118122
else
119123
return (o instanceof Sequential || o instanceof List) && RT.seq(o) == null;
120124
}

src/jvm/clojure/lang/Namespace.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private void warnOrFailOnReplace(Symbol sym, Object o, Object v){
8282
if (o instanceof Var)
8383
{
8484
Namespace ns = ((Var)o).ns;
85-
if (ns == this)
85+
if (ns == this || (v instanceof Var && ((Var)v).ns == RT.CLOJURE_NS))
8686
return;
8787
if (ns != RT.CLOJURE_NS)
8888
throw new IllegalStateException(sym + " already refers to: " + o + " in namespace: " + name);

src/script/run_test.clj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(System/setProperty "java.awt.headless" "true")
2+
(require
3+
'[clojure.test :as test]
4+
'[clojure.tools.namespace :as ns])
5+
(def namespaces (ns/find-namespaces-in-dir (java.io.File. "test")))
6+
(doseq [ns namespaces] (require ns))
7+
(let [summary (apply test/run-tests namespaces)]
8+
(System/exit (if (test/successful? summary) 0 -1)))
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
(System/setProperty "clojure.test.generative.msec" "60000")
21
(System/setProperty "java.awt.headless" "true")
2+
(when-not (System/getProperty "clojure.test.generative.msec")
3+
(System/setProperty "clojure.test.generative.msec" "60000"))
34
(require '[clojure.test.generative.runner :as runner])
45
(runner/-main "test")

test/clojure/test_clojure/sequences.clj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@
9898
(lazy-seq [])
9999
(lazy-seq [1 2]))
100100

101+
(is (not (.equals (lazy-seq [3]) (lazy-seq [3N]))))
102+
101103
(are [x y] (= x y)
102104
(lazy-seq nil) ()
103105
(lazy-seq [nil]) '(nil)
@@ -109,6 +111,7 @@
109111
(lazy-seq "") ()
110112
(lazy-seq (into-array [])) ()
111113

114+
(lazy-seq [3]) [3N]
112115
(lazy-seq (list 1 2)) '(1 2)
113116
(lazy-seq [1 2]) '(1 2)
114117
(lazy-seq (sorted-set 1 2)) '(1 2)
@@ -120,6 +123,7 @@
120123
(deftest test-seq
121124
(is (not (seq? (seq []))))
122125
(is (seq? (seq [1 2])))
126+
(is (not (.equals (seq [3]) (seq [3N]))))
123127

124128
(are [x y] (= x y)
125129
(seq nil) nil
@@ -132,6 +136,7 @@
132136
(seq "") nil
133137
(seq (into-array [])) nil
134138

139+
(seq [3]) [3N]
135140
(seq (list 1 2)) '(1 2)
136141
(seq [1 2]) '(1 2)
137142
(seq (sorted-set 1 2)) '(1 2)

0 commit comments

Comments
 (0)