comparison lisp/emacs-lisp/cl.el @ 30613:a262f769fc3d

(first, ..., tenth): Make them macros. (toplevel): Remove `remq' and `remove' from autoloads. (cl-fake-autoloads): New variable. If set, arrange for an error when CL functions etc. are autoloaded.
author Gerd Moellmann <gerd@gnu.org>
date Sat, 05 Aug 2000 20:09:44 +0000
parents add63b27c709
children 5e28cf8a757a
comparison
equal deleted inserted replaced
30612:a019ed819488 30613:a262f769fc3d
330 330
331 (defalias 'first 'car) 331 (defalias 'first 'car)
332 (defalias 'rest 'cdr) 332 (defalias 'rest 'cdr)
333 (defalias 'endp 'null) 333 (defalias 'endp 'null)
334 334
335 (defun second (x) 335 (defmacro second (x)
336 "Return the second element of the list LIST." 336 "Return the second element of the list LIST."
337 (car (cdr x))) 337 `(car (cdr ,x)))
338 338
339 (defun third (x) 339 (defmacro third (x)
340 "Return the third element of the list LIST." 340 "Return the third element of the list LIST."
341 (car (cdr (cdr x)))) 341 `(car (cdr (cdr ,x))))
342 342
343 (defun fourth (x) 343 (defmacro fourth (x)
344 "Return the fourth element of the list LIST." 344 "Return the fourth element of the list LIST."
345 (nth 3 x)) 345 `(nth 3 ,x))
346 346
347 (defun fifth (x) 347 (defmacro fifth (x)
348 "Return the fifth element of the list LIST." 348 "Return the fifth element of the list LIST."
349 (nth 4 x)) 349 `(nth 4 ,x))
350 350
351 (defun sixth (x) 351 (defmacro sixth (x)
352 "Return the sixth element of the list LIST." 352 "Return the sixth element of the list LIST."
353 (nth 5 x)) 353 `(nth 5 ,x))
354 354
355 (defun seventh (x) 355 (defmacro seventh (x)
356 "Return the seventh element of the list LIST." 356 "Return the seventh element of the list LIST."
357 (nth 6 x)) 357 `(nth 6 ,x))
358 358
359 (defun eighth (x) 359 (defmacro eighth (x)
360 "Return the eighth element of the list LIST." 360 "Return the eighth element of the list LIST."
361 (nth 7 x)) 361 `(nth 7 ,x))
362 362
363 (defun ninth (x) 363 (defmacro ninth (x)
364 "Return the ninth element of the list LIST." 364 "Return the ninth element of the list LIST."
365 (nth 8 x)) 365 `(nth 8 ,x))
366 366
367 (defun tenth (x) 367 (defmacro tenth (x)
368 "Return the tenth element of the list LIST." 368 "Return the tenth element of the list LIST."
369 (nth 9 x)) 369 `(nth 9 ,x))
370 370
371 (defun caaar (x) 371 (defun caaar (x)
372 "Return the `car' of the `car' of the `car' of X." 372 "Return the `car' of the `car' of the `car' of X."
373 (car (car (car x)))) 373 (car (car (car x))))
374 374
563 ;;; Miscellaneous. 563 ;;; Miscellaneous.
564 564
565 (put 'cl-assertion-failed 'error-conditions '(error)) 565 (put 'cl-assertion-failed 'error-conditions '(error))
566 (put 'cl-assertion-failed 'error-message "Assertion failed") 566 (put 'cl-assertion-failed 'error-message "Assertion failed")
567 567
568 (defvar cl-fake-autoloads nil
569 "Non-nil means don't make CL functions autoload.")
570
568 ;;; Autoload the other portions of the package. 571 ;;; Autoload the other portions of the package.
569 (mapcar (function 572 (mapcar (function
570 (lambda (set) 573 (lambda (set)
571 (mapcar (function 574 (let ((file (if cl-fake-autoloads "<none>" (car set))))
572 (lambda (func) 575 (mapcar (function
573 (autoload func (car set) nil nil (nth 1 set)))) 576 (lambda (func)
574 (cddr set)))) 577 (autoload func (car set) nil nil (nth 1 set))))
578 (cddr set)))))
575 '(("cl-extra" nil 579 '(("cl-extra" nil
576 coerce equalp cl-map-keymap maplist mapc mapl mapcan mapcon 580 coerce equalp cl-map-keymap maplist mapc mapl mapcan mapcon
577 cl-map-keymap cl-map-keymap-recursively cl-map-intervals 581 cl-map-keymap cl-map-keymap-recursively cl-map-intervals
578 cl-map-overlays cl-set-frame-visible-p cl-float-limits 582 cl-map-overlays cl-set-frame-visible-p cl-float-limits
579 gcd lcm isqrt floor* ceiling* truncate* round* 583 gcd lcm isqrt floor* ceiling* truncate* round*
583 cl-set-getf cl-do-remf remprop cl-make-hash-table cl-hash-lookup 587 cl-set-getf cl-do-remf remprop cl-make-hash-table cl-hash-lookup
584 cl-gethash cl-puthash cl-remhash cl-clrhash cl-maphash cl-hash-table-p 588 cl-gethash cl-puthash cl-remhash cl-clrhash cl-maphash cl-hash-table-p
585 cl-hash-table-count cl-progv-before cl-prettyexpand 589 cl-hash-table-count cl-progv-before cl-prettyexpand
586 cl-macroexpand-all) 590 cl-macroexpand-all)
587 ("cl-seq" nil 591 ("cl-seq" nil
588 reduce fill replace remq remove remove* remove-if remove-if-not 592 reduce fill replace remove* remove-if remove-if-not
589 delete* delete-if delete-if-not remove-duplicates 593 delete* delete-if delete-if-not remove-duplicates
590 delete-duplicates substitute substitute-if substitute-if-not 594 delete-duplicates substitute substitute-if substitute-if-not
591 nsubstitute nsubstitute-if nsubstitute-if-not find find-if 595 nsubstitute nsubstitute-if nsubstitute-if-not find find-if
592 find-if-not position position-if position-if-not count count-if 596 find-if-not position position-if position-if-not count count-if
593 count-if-not mismatch search sort* stable-sort merge member* 597 count-if-not mismatch search sort* stable-sort merge member*