;;; extract a value with (extract-from-klist KLIST KEY [DEFAULT]).
(defun reduce (function sequence &rest kargs)
- "Apply FUNCTION (a function of two arguments) to succesive pairs of elements
+ "Apply FUNCTION (a function of two arguments) to successive pairs of elements
from SEQUENCE. Some keyword arguments are valid after FUNCTION and SEQUENCE:
:from-end If non-nil, process the values backwards
:initial-value If given, prefix it to the SEQUENCE. Suffix, if :from-end
;;;; Both list and sequence functions are considered here together. This
;;;; doesn't fit any more with the original split of functions in files.
-(defun member (item list &rest kargs)
+(defun cl-member (item list &rest kargs)
"Look for ITEM in LIST; return first tail of LIST the car of whose first
cons cell tests the same as ITEM. Admits arguments :key, :test, and
:test-not."
(do* ((absa (abs (nth 0 integers))) ; better to operate only
(absb (abs (nth 1 integers))) ;on positives.
(dd (max absa absb)) ; setup correct order for the
- (ds (min absa absb)) ;succesive divisions.
+ (ds (min absa absb)) ;successive divisions.
;; intermediate results
(q 0)
(r 0)
done (or (= new approx) (= new (+ approx 1)))
approx new)))))
\f
-(defun floor (number &optional divisor)
+(defun cl-floor (number &optional divisor)
"Divide DIVIDEND by DIVISOR, rounding toward minus infinity.
DIVISOR defaults to 1. The remainder is produced as a second value."
(cond ((and (null divisor) ; trivial case
(let ((q (- (+ q 1))))
(values q (- number (* q divisor)))))))))))
-(defun ceiling (number &optional divisor)
+(defun cl-ceiling (number &optional divisor)
"Divide DIVIDEND by DIVISOR, rounding toward plus infinity.
DIVISOR defaults to 1. The remainder is produced as a second value."
(cond ((and (null divisor) ; trivial case
(t
(values (- q) (+ number (* q divisor)))))))))
\f
-(defun truncate (number &optional divisor)
+(defun cl-truncate (number &optional divisor)
"Divide DIVIDEND by DIVISOR, rounding toward zero.
DIVISOR defaults to 1. The remainder is produced as a second value."
(cond ((and (null divisor) ; trivial case
(t ;same as ceiling
(values (- q) (+ number (* q divisor)))))))))
-(defun round (number &optional divisor)
+(defun cl-round (number &optional divisor)
"Divide DIVIDEND by DIVISOR, rounding to nearest integer.
DIVISOR defaults to 1. The remainder is produced as a second value."
(cond ((and (null divisor) ; trivial case
;;; These two functions access the implementation-dependent representation of
;;; the multiple value returns.
-(defun mod (number divisor)
+(defun cl-mod (number divisor)
"Return remainder of X by Y (rounding quotient toward minus infinity).
-That is, the remainder goes with the quotient produced by `floor'.
+That is, the remainder goes with the quotient produced by `cl-floor'.
Emacs Lisp hint:
If you know that both arguments are positive, use `%' instead for speed."
- (floor number divisor)
+ (cl-floor number divisor)
(cadr *mvalues-values*))
(defun rem (number divisor)
"Return remainder of X by Y (rounding quotient toward zero).
-That is, the remainder goes with the quotient produced by `truncate'.
+That is, the remainder goes with the quotient produced by `cl-truncate'.
Emacs Lisp hint:
If you know that both arguments are positive, use `%' instead for speed."
- (truncate number divisor)
+ (cl-truncate number divisor)
(cadr *mvalues-values*))
\f
;;; internal utilities
(defsetf apply
(lambda (&rest args)
- ;; dissasemble the calling form
+ ;; disassemble the calling form
;; "(((quote fn) x1 x2 ... xn) val)" (function instead of quote, too)
(let* ((fnform (car args)) ;functional form
(applyargs (append ;arguments "to apply fnform"
list \{:conc-name, :copier, :constructor, :predicate, :include,
:print-function, :type, :initial-offset\}. The meanings of these are as in
CLtL, except that no BOA-constructors are provided, and the options
-\{:print-fuction, :type, :initial-offset\} are ignored quietly. All these
+\{:print-function, :type, :initial-offset\} are ignored quietly. All these
structs are named, in the sense that their names can be used for type
discrimination.