;;; can safely be used in .emacs files.
(defmacro incf (place &optional x)
- "(incf PLACE [X]): increment PLACE by X (1 by default).
+ "Increment PLACE by X (1 by default).
PLACE may be a symbol, or any generalized variable allowed by `setf'.
The return value is the incremented value of PLACE."
(if (symbolp place)
(list 'callf '+ place (or x 1))))
(defmacro decf (place &optional x)
- "(decf PLACE [X]): decrement PLACE by X (1 by default).
+ "Decrement PLACE by X (1 by default).
PLACE may be a symbol, or any generalized variable allowed by `setf'.
The return value is the decremented value of PLACE."
(if (symbolp place)
(list 'callf '- place (or x 1))))
(defmacro pop (place)
- "(pop PLACE): remove and return the head of the list stored in PLACE.
+ "Remove and return the head of the list stored in PLACE.
Analogous to (prog1 (car PLACE) (setf PLACE (cdr PLACE))), though more
careful about evaluating each argument only once and in the right order.
PLACE may be a symbol, or any generalized variable allowed by `setf'."
(cl-do-pop place)))
(defmacro push (x place)
- "(push X PLACE): insert X at the head of the list stored in PLACE.
+ "Insert X at the head of the list stored in PLACE.
Analogous to (setf PLACE (cons X PLACE)), though more careful about
evaluating each argument only once and in the right order. PLACE may
be a symbol, or any generalized variable allowed by `setf'."
Otherwise, the macro is expanded and the expansion is considered
in place of FORM. When a non-macro-call results, it is returned.
-The second optional arg ENVIRONMENT species an environment of macro
+The second optional arg ENVIRONMENT specifies an environment of macro
definitions to shadow the loaded ones for use in file byte-compilation."
(let ((cl-macro-environment cl-env))
(while (progn (setq cl-macro (funcall cl-old-macroexpand cl-macro cl-env))
;;; List functions.
(defalias 'first 'car)
+(defalias 'second 'cadr)
(defalias 'rest 'cdr)
(defalias 'endp 'null)
-(defun second (x)
- "Return the second element of the list LIST."
- (car (cdr x)))
-
(defun third (x)
"Return the third element of the list LIST."
- (car (cdr (cdr x))))
+ `(car (cdr (cdr ,x))))
(defun fourth (x)
"Return the fourth element of the list LIST."
- (nth 3 x))
+ `(nth 3 ,x))
(defun fifth (x)
"Return the fifth element of the list LIST."
- (nth 4 x))
+ `(nth 4 ,x))
(defun sixth (x)
"Return the sixth element of the list LIST."
- (nth 5 x))
+ `(nth 5 ,x))
(defun seventh (x)
"Return the seventh element of the list LIST."
- (nth 6 x))
+ `(nth 6 ,x))
(defun eighth (x)
"Return the eighth element of the list LIST."
- (nth 7 x))
+ `(nth 7 ,x))
(defun ninth (x)
"Return the ninth element of the list LIST."
- (nth 8 x))
+ `(nth 8 ,x))
(defun tenth (x)
"Return the tenth element of the list LIST."
- (nth 9 x))
+ `(nth 9 ,x))
(defun caaar (x)
"Return the `car' of the `car' of the `car' of X."
(put 'cl-assertion-failed 'error-conditions '(error))
(put 'cl-assertion-failed 'error-message "Assertion failed")
+(defvar cl-fake-autoloads nil
+ "Non-nil means don't make CL functions autoload.")
+
;;; Autoload the other portions of the package.
(mapcar (function
(lambda (set)
- (mapcar (function
- (lambda (func)
- (autoload func (car set) nil nil (nth 1 set))))
- (cddr set))))
+ (let ((file (if cl-fake-autoloads "<none>" (car set))))
+ (mapcar (function
+ (lambda (func)
+ (autoload func (car set) nil nil (nth 1 set))))
+ (cddr set)))))
'(("cl-extra" nil
coerce equalp cl-map-keymap maplist mapc mapl mapcan mapcon
cl-map-keymap cl-map-keymap-recursively cl-map-intervals
cl-map-overlays cl-set-frame-visible-p cl-float-limits
- gcd lcm isqrt expt floor* ceiling* truncate* round*
+ gcd lcm isqrt floor* ceiling* truncate* round*
mod* rem* signum random* make-random-state random-state-p
subseq concatenate cl-mapcar-many map some every notany
notevery revappend nreconc list-length tailp copy-tree get* getf
cl-hash-table-count cl-progv-before cl-prettyexpand
cl-macroexpand-all)
("cl-seq" nil
- reduce fill replace remq remove remove* remove-if remove-if-not
- delete delete* delete-if delete-if-not remove-duplicates
+ reduce fill replace remove* remove-if remove-if-not
+ delete* delete-if delete-if-not remove-duplicates
delete-duplicates substitute substitute-if substitute-if-not
nsubstitute nsubstitute-if nsubstitute-if-not find find-if
find-if-not position position-if position-if-not count count-if
count-if-not mismatch search sort* stable-sort merge member*
member-if member-if-not cl-adjoin assoc* assoc-if assoc-if-not
- rassoc* rassoc rassoc-if rassoc-if-not union nunion intersection
+ rassoc* rassoc-if rassoc-if-not union nunion intersection
nintersection set-difference nset-difference set-exclusive-or
nset-exclusive-or subsetp subst-if subst-if-not nsubst nsubst-if
nsubst-if-not sublis nsublis tree-equal)