summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2009-04-27 17:37:21 +0000
committerRich Hickey <richhickey@gmail.com>2009-04-27 17:37:21 +0000
commite9212ed36488b6fab3809082e8771c19be81da84 (patch)
tree35f8ea75b0b763ce3b31eebcc22f6cde2d7a67f8
parentbe925c49b9d7c9e799711fd4caa4cf248ac16023 (diff)
got rid of assert-if-lazy-seq, if*, and if as macro
-rw-r--r--build.xml2
-rw-r--r--src/clj/clojure/core.clj18
-rw-r--r--src/jvm/clojure/lang/Compiler.java2
3 files changed, 1 insertions, 21 deletions
diff --git a/build.xml b/build.xml
index 690f1e7a..c385958f 100644
--- a/build.xml
+++ b/build.xml
@@ -15,7 +15,6 @@
<property name="clojure_jar" location="clojure.jar"/>
<property name="slim_jar" location="clojure-slim.jar"/>
<property name="src_jar" location="clojure-sources.jar"/>
- <property name="clojure.assert-if-lazy-seq" value=""/>
<!-- These make sense for building on tapestry.formos.com -->
@@ -38,7 +37,6 @@
<java classname="clojure.lang.Compile"
classpath="${build}:${cljsrc}">
<sysproperty key="clojure.compile.path" value="${build}"/>
- <sysproperty key="clojure.assert-if-lazy-seq" value="${clojure.assert-if-lazy-seq}"/>
<arg value="clojure.core"/>
<arg value="clojure.main"/>
<arg value="clojure.set"/>
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index 25cb5d18..2f126fb8 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -38,10 +38,6 @@
fn (fn* fn [& decl] (cons 'fn* decl)))
(def
- #^{:macro true}
- if (fn* if [& decl] (cons 'if* decl)))
-
-(def
#^{:arglists '([coll])
:doc "Returns the first item in the collection. Calls seq on its
argument. If coll is nil, returns nil."}
@@ -294,20 +290,6 @@
(. (var defmacro) (setMacro))
-(defmacro assert-if-lazy-seq? {:private true} []
- (let [prop (System/getProperty "clojure.assert-if-lazy-seq")]
- (if prop
- (if (clojure.lang.Util/equals prop "") nil true))))
-
-(defmacro if [tst & etc]
- (if* (assert-if-lazy-seq?)
- (let [tstsym 'G__0_0]
- (list 'clojure.core/let [tstsym tst]
- (list 'if* (list 'clojure.core/instance? clojure.lang.LazySeq tstsym)
- (list 'throw (list 'new Exception "LazySeq used in 'if'"))
- (cons 'if* (cons tstsym etc)))))
- (cons 'if* (cons tst etc))))
-
(defmacro when
"Evaluates test. If logical true, evaluates body in an implicit do."
[test & body]
diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java
index 51a64d27..b84ee857 100644
--- a/src/jvm/clojure/lang/Compiler.java
+++ b/src/jvm/clojure/lang/Compiler.java
@@ -37,7 +37,7 @@ public class Compiler implements Opcodes{
static final Symbol DEF = Symbol.create("def");
static final Symbol LOOP = Symbol.create("loop*");
static final Symbol RECUR = Symbol.create("recur");
-static final Symbol IF = Symbol.create("if*");
+static final Symbol IF = Symbol.create("if");
static final Symbol LET = Symbol.create("let*");
static final Symbol LETFN = Symbol.create("letfn*");
static final Symbol DO = Symbol.create("do");