Update of /cvsroot/wisp/wisp/modules
In directory usw-pr-cvs1:/tmp/cvs-serv5806/modules
Modified Files:
random.wim
Log Message:
Made random.wim avoid |vector-length| in favour of |length|.
Index: random.wim
===================================================================
RCS file: /cvsroot/wisp/wisp/modules/random.wim,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- random.wim 4 Sep 2002 14:31:41 -0000 1.24
+++ random.wim 7 Sep 2002 21:58:27 -0000 1.25
@@ -51,7 +51,7 @@
(modulo (take-random-bits (* lm 16) source) limit)))
(define (shuffle-vector! vec (source 'urandom))
- (my i (vector-length vec)
+ (my i (length vec)
(while (positive? i)
(my j (random-integer i source)
(decr! i)
@@ -73,11 +73,11 @@
(emit line)
(iter))))))))))
(close-input-port port)
- (if (and count (< (vector-length vec) count))
+ (if (and count (< (length vec) count))
(raise 'too-few-lines (cons count file-name)))
(shuffle-vector! vec source)
(my res '()
- (my i (or count (vector-length vec))
+ (my i (or count (length vec))
(while (not (zero? i))
(decr! i)
(cons! res vec[i])))
|