comparison lisp/cl.el @ 5281:aa20a889ff14

Remove a couple of redundant functions, backquote.el 2010-10-10 Aidan Kehoe <kehoea@parhasard.net> * backquote.el (bq-vector-contents, bq-list*): Remove; the former is equivalent to (append VECTOR nil), the latter to (list* ...). (bq-process-2): Use (append VECTOR nil) instead of using #'bq-vector-contents to convert to a list. (bq-process-1): Now we use list* instead of bq-list * subr.el (list*): Moved from cl.el, since it is now required to be available the first time a backquoted form is encountered. * cl.el (list*): Move to subr.el.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 10 Oct 2010 12:13:32 +0100
parents 2d0937dc83cf
children 99de5fd48e87
comparison
equal deleted inserted replaced
5280:59a6419f7504 5281:aa20a889ff14
517 "Return the `cdr' of the `cdr' of the `cdr' of the `cdr' of X." 517 "Return the `cdr' of the `cdr' of the `cdr' of the `cdr' of X."
518 (cdr (cdr (cdr (cdr x))))) 518 (cdr (cdr (cdr (cdr x)))))
519 519
520 ;;; `last' is implemented as a C primitive, as of 1998-11 520 ;;; `last' is implemented as a C primitive, as of 1998-11
521 521
522 (defun list* (arg &rest rest) ; See compiler macro in cl-macs.el 522 ;;; XEmacs: `list*' is in subr.el.
523 "Return a new list with specified args as elements, cons'd to last arg.
524 Thus, `(list* A B C D)' is equivalent to `(nconc (list A B C) D)', or to
525 `(cons A (cons B (cons C D)))'."
526 (cond ((not rest) arg)
527 ((not (cdr rest)) (cons arg (car rest)))
528 (t (let* ((n (length rest))
529 (copy (copy-sequence rest))
530 (last (nthcdr (- n 2) copy)))
531 (setcdr last (car (cdr last)))
532 (cons arg copy)))))
533 523
534 (defun ldiff (list sublist) 524 (defun ldiff (list sublist)
535 "Return a copy of LIST with the tail SUBLIST removed." 525 "Return a copy of LIST with the tail SUBLIST removed."
536 (let ((res nil)) 526 (let ((res nil))
537 (while (and (consp list) (not (eq list sublist))) 527 (while (and (consp list) (not (eq list sublist)))