diff options
author | Rich Hickey <richhickey@gmail.com> | 2007-10-14 23:17:31 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2007-10-14 23:17:31 +0000 |
commit | 8d97d8311037125a74d1f21efbea1581adcf3cd0 (patch) | |
tree | ab75ef48e18686500e62247ef97cec68492aef64 | |
parent | 2c1fbde3089f2d38bb6aaa46f041b28c8013003b (diff) |
swapped :t for t
-rw-r--r-- | src/boot.clj | 28 | ||||
-rw-r--r-- | src/jvm/clojure/lang/Compiler.java | 4 | ||||
-rw-r--r-- | src/jvm/clojure/lang/RT.java | 2 |
3 files changed, 21 insertions, 13 deletions
diff --git a/src/boot.clj b/src/boot.clj index d01082fe..bfa3d21f 100644 --- a/src/boot.clj +++ b/src/boot.clj @@ -54,9 +54,7 @@ (defmacro when-not [test & body] (list 'if test nil (cons 'do body))) -(def t (. clojure.lang.RT T)) - -(defn nil? [x] (if x nil t)) +(defn nil? [x] (if x nil :t)) (defn not [x] (nil? x)) @@ -124,7 +122,7 @@ ;;at this point all the support for syntax-quote exists (defmacro and - ([] t) + ([] :t) ([x] x) ([x & rest] `(if ~x (and ~@rest)))) @@ -163,31 +161,31 @@ (apply thisfn (thisfn x y) rest))) (defn < - ([x] t) + ([x] :t) ([x y] (. clojure.lang.Num (lt x y))) ([x y & rest] (and (thisfn x y) (apply thisfn y rest)))) (defn <= - ([x] t) + ([x] :t) ([x y] (. clojure.lang.Num (lte x y))) ([x y & rest] (and (thisfn x y) (apply thisfn y rest)))) (defn > - ([x] t) + ([x] :t) ([x y] (. clojure.lang.Num (gt x y))) ([x y & rest] (and (thisfn x y) (apply thisfn y rest)))) (defn >= - ([x] t) + ([x] :t) ([x y] (. clojure.lang.Num (gte x y))) ([x y & rest] (and (thisfn x y) (apply thisfn y rest)))) (defn == - ([x] t) + ([x] :t) ([x y] (. clojure.lang.Num (equiv x y))) ([x y & rest] (and (thisfn x y) (apply thisfn y rest)))) @@ -391,7 +389,7 @@ (if (seq coll) (and (pred (first coll)) (recur pred (rest coll))) - t)) + :t)) (def not-every (comp not every)) @@ -466,6 +464,16 @@ (defn merge [& maps] (reduce conj maps)) +(defn zipmap [keys vals] + (loop [map {} + ks (seq keys) + vs (seq vals)] + (if (and ks vs) + (recur (assoc map (first ks) (first vs)) + (rest ks) + (rest vs)) + map))) + ;; evaluation (defn eval [form] diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java index eb25c785..241832db 100644 --- a/src/jvm/clojure/lang/Compiler.java +++ b/src/jvm/clojure/lang/Compiler.java @@ -458,7 +458,7 @@ static abstract class HostExpr implements Expr{ Label falseLabel = gen.newLabel(); Label endLabel = gen.newLabel(); gen.ifZCmp(GeneratorAdapter.EQ, falseLabel); - gen.getStatic(RT_TYPE, "T", SYMBOL_TYPE); + gen.getStatic(RT_TYPE, "T", KEYWORD_TYPE); gen.goTo(endLabel); gen.mark(falseLabel); NIL_EXPR.emit(C.EXPRESSION, fn, gen); @@ -1355,7 +1355,7 @@ static class InstanceExpr extends UntypedExpr{ expr.emit(C.EXPRESSION, fn, gen); gen.instanceOf(Type.getObjectType(className.replace('.', '/'))); gen.ifZCmp(GeneratorAdapter.EQ, not); - gen.getStatic(RT_TYPE, "T", SYMBOL_TYPE); + gen.getStatic(RT_TYPE, "T", KEYWORD_TYPE); gen.goTo(end); gen.mark(not); NIL_EXPR.emit(C.EXPRESSION, fn, gen); diff --git a/src/jvm/clojure/lang/RT.java b/src/jvm/clojure/lang/RT.java index a555ef0c..6de45959 100644 --- a/src/jvm/clojure/lang/RT.java +++ b/src/jvm/clojure/lang/RT.java @@ -19,7 +19,7 @@ import java.lang.reflect.Array; public class RT{ -static public Symbol T = Symbol.create(null, "t"); +static public Keyword T = Keyword.intern(Symbol.create(null, "t")); final static public Var OUT = Var.intern(Symbol.create("clojure", "*out*"), new OutputStreamWriter(System.out)); final static Keyword TAG_KEY = Keyword.intern("clojure", "tag"); |