summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2008-02-14 21:33:42 +0000
committerRich Hickey <richhickey@gmail.com>2008-02-14 21:33:42 +0000
commitca6d46d816d04c45f513463a08e9fde257bd59a0 (patch)
tree9808ed6c0025fc3f9e5813653f276672e9e909af
parenta2a3bc0a1b8f21b777cff92d2a1186538051fee3 (diff)
added rand, rand-int and defn-
-rw-r--r--src/boot.clj9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/boot.clj b/src/boot.clj
index a0ed368b..12258da8 100644
--- a/src/boot.clj
+++ b/src/boot.clj
@@ -1304,3 +1304,12 @@ test [v]
(let [m (re-matcher re s)]
(re-find m))))
+(defn rand
+ ([] (. Math (random)))
+ ([n] (* n (rand))))
+
+(defn rand-int [n]
+ (int (rand n)))
+
+(defmacro defn- [name & decls]
+ (list* `defn (with-meta name (assoc (meta name) :private true)) decls))