diff options
author | Rich Hickey <richhickey@gmail.com> | 2008-02-14 21:33:42 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2008-02-14 21:33:42 +0000 |
commit | ca6d46d816d04c45f513463a08e9fde257bd59a0 (patch) | |
tree | 9808ed6c0025fc3f9e5813653f276672e9e909af | |
parent | a2a3bc0a1b8f21b777cff92d2a1186538051fee3 (diff) |
added rand, rand-int and defn-
-rw-r--r-- | src/boot.clj | 9 |
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)) |