summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2009-02-10 17:24:20 +0000
committerRich Hickey <richhickey@gmail.com>2009-02-10 17:24:20 +0000
commit3d30e8c97631bdf5c7527cfac358d78addd7790a (patch)
treedc746138997bd93b1641381c27433b41c6da398a
parent3e4c6f003de2a50d164a90defb566dba93f465a1 (diff)
added inlining on remaining coercions
-rw-r--r--src/clj/clojure/core.clj12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index 6eeda3ba..e68f7c3b 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -1825,22 +1825,26 @@
(defn short
"Coerce to short"
- {:tag Short}
+ {:tag Short
+ :inline (fn [x] `(. clojure.lang.RT (shortCast ~x)))}
[#^Number x] (. x (shortValue)))
(defn byte
"Coerce to byte"
- {:tag Byte}
+ {:tag Byte
+ :inline (fn [x] `(. clojure.lang.RT (byteCast ~x)))}
[#^Number x] (. x (byteValue)))
(defn char
"Coerce to char"
- {:tag Character}
+ {:tag Character
+ :inline (fn [x] `(. clojure.lang.RT (charCast ~x)))}
[x] (. clojure.lang.RT (charCast x)))
(defn boolean
"Coerce to boolean"
- {:tag Boolean}
+ {:tag Boolean
+ :inline (fn [x] `(. clojure.lang.RT (booleanCast ~x)))}
[x] (if x true false))
(defn number?