Format and doc changes to bring closer to xterm.c.
[bpt/emacs.git] / lisp / cl.el
index db477e1..1a6a385 100644 (file)
@@ -1,4 +1,5 @@
-;; Common-Lisp extensions for GNU Emacs Lisp.
+;;; cl.el --- Common-Lisp extensions for GNU Emacs Lisp.
+
 ;; Copyright (C) 1987, 1988, 1989, 1992  Free Software Foundation, Inc.
 
 ;; Author: Cesar Quiroz <quiroz@cs.rochester.edu>
@@ -23,6 +24,8 @@
 ;; file named COPYING.  Among other things, the copyright notice
 ;; and this notice must be preserved on all copies.
 
+;;; Commentary:
+
 ;;; Notes from Rob Austein on his mods
 ;; yaya:/usr/u/sra/cl/cl.el, 5-May-1991 16:01:34, sra
 ;;
@@ -46,8 +49,6 @@
 ;;     at compile time?  Lisp is going to check for a binding at run-time
 ;;     anyway, so maybe we should just assume the user's right here.
 
-;;; Commentary:
-
 ;;;; These are extensions to Emacs Lisp that provide some form of
 ;;;; Common Lisp compatibility, beyond what is already built-in
 ;;;; in Emacs Lisp.
@@ -1357,7 +1358,7 @@ if clumsier, control over this feature."
 ;;; 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
@@ -1416,7 +1417,7 @@ returned."
 ;;;; 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."
@@ -1664,7 +1665,7 @@ The arguments must be integers.  With no arguments, value is zero."
            (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)
@@ -1723,7 +1724,7 @@ equal to the real square root of the argument."
                  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
@@ -1743,7 +1744,7 @@ DIVISOR defaults to 1.  The remainder is produced as a second value."
                     (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
@@ -1760,7 +1761,7 @@ DIVISOR defaults to 1.  The remainder is produced as a second value."
                  (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
@@ -1777,7 +1778,7 @@ DIVISOR defaults to 1.  The remainder is produced as a second value."
                  (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
@@ -1803,20 +1804,20 @@ DIVISOR defaults to 1.  The remainder is produced as a second value."
 ;;; 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
@@ -1967,7 +1968,7 @@ updating called for."
 
 (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"
@@ -2382,7 +2383,7 @@ Each option is either a symbol, or a list of a keyword symbol taken from the
 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.