comparison lisp/cl.el @ 4998:b46c89ccbed3

Merge.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 06 Feb 2010 12:28:19 +0000
parents 8431b52e43b1
children 545ec923b4eb
comparison
equal deleted inserted replaced
4994:76af7fc13e81 4998:b46c89ccbed3
364 364
365 ;;; Sequence functions. 365 ;;; Sequence functions.
366 366
367 (defalias 'copy-seq 'copy-sequence) 367 (defalias 'copy-seq 'copy-sequence)
368 368
369 (defun mapcar* (cl-func cl-x &rest cl-rest)
370 "Apply FUNCTION to each element of SEQ, and make a list of the results.
371 If there are several SEQs, FUNCTION is called with that many arguments,
372 and mapping stops as soon as the shortest list runs out. With just one
373 SEQ, this is like `mapcar'. With several, it is like the Common Lisp
374 `mapcar' function extended to arbitrary sequence types."
375 (if cl-rest
376 (if (or (cdr cl-rest) (nlistp cl-x) (nlistp (car cl-rest)))
377 (cl-mapcar-many cl-func (cons cl-x cl-rest))
378 (let ((cl-res nil) (cl-y (car cl-rest)))
379 (while (and cl-x cl-y)
380 (push (funcall cl-func (pop cl-x) (pop cl-y)) cl-res))
381 (nreverse cl-res)))
382 (mapcar cl-func cl-x)))
383
384 (defalias 'svref 'aref) 369 (defalias 'svref 'aref)
385 370
386 ;;; List functions. 371 ;;; List functions.
387 372
388 ;; These functions are made known to the byte-compiler by cl-macs.el 373 ;; These functions are made known to the byte-compiler by cl-macs.el
636 (define-error 'cl-assertion-failed "Assertion failed") 621 (define-error 'cl-assertion-failed "Assertion failed")
637 622
638 ;; XEmacs change: omit the autoload rules; we handle those a different way 623 ;; XEmacs change: omit the autoload rules; we handle those a different way
639 624
640 ;;; Define data for indentation and edebug. 625 ;;; Define data for indentation and edebug.
641 (mapc-internal 626 (mapc
642 #'(lambda (entry) 627 #'(lambda (entry)
643 (mapc-internal 628 (mapc
644 #'(lambda (func) 629 #'(lambda (func)
645 (put func 'lisp-indent-function (nth 1 entry)) 630 (put func 'lisp-indent-function (nth 1 entry))
646 (put func 'lisp-indent-hook (nth 1 entry)) 631 (put func 'lisp-indent-hook (nth 1 entry))
647 (or (get func 'edebug-form-spec) 632 (or (get func 'edebug-form-spec)
648 (put func 'edebug-form-spec (nth 2 entry)))) 633 (put func 'edebug-form-spec (nth 2 entry))))