Commit 2d661f61 authored by Stelian Ionescu's avatar Stelian Ionescu
Browse files

Fix some type declarations for CLISP-compatibility.

Type declareations like ((or fixnum null) bar) or (unsigned-byte foo)
don't work on CLISP. Must use (type unsigned-byte foo) instead.
parent c5b5ffea
......@@ -183,7 +183,7 @@ minimum of its original value and NUMBERS.")
(m (1- k) (1- m)))
((< m j) f)
(declare (type (integer 0 (#.most-positive-fixnum)) m)
(unsigned-byte f)))))
(type unsigned-byte f)))))
(bisect i j)))
(declaim (inline factorial))
......
......@@ -53,7 +53,7 @@ result sequence may share structure with it."
"Returns a random permutation of SEQUENCE bounded by START and END.
Permuted sequence may share storage with the original one. Signals
an error if SEQUENCE is not a proper sequence."
(declare (fixnum start) ((or fixnum null) end))
(declare (fixnum start) (type (or fixnum null) end))
(let ((end (or end (if (listp sequence) (list-length sequence) (length sequence)))))
(loop for i from start below end
do (rotatef (elt sequence i) (elt sequence (random end)))))
......@@ -62,7 +62,7 @@ an error if SEQUENCE is not a proper sequence."
(defun random-elt (sequence &key (start 0) end)
"Returns a random element from SEQUENCE bounded by START and END. Signals an
error if the SEQUENCE is not a proper sequence."
(declare (sequence sequence) (fixnum start) ((or fixnum null) end))
(declare (sequence sequence) (fixnum start) (type (or fixnum null) end))
(let ((i (+ start (random (- (or end (if (listp sequence)
(list-length sequence)
(length sequence)))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment