]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/cl.el
* lisp/emacs-lisp/package.el (package-refresh-contents):
[gnu-emacs] / lisp / emacs-lisp / cl.el
index be7b6f4022a75f5de5e532a7e214ae64264d6529..e48376bbabd8c2a710f638222b8a2e0d4821f5f5 100644 (file)
@@ -1,6 +1,6 @@
 ;;; cl.el --- Compatibility aliases for the old CL library.  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2012-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: extensions
                copy-list
                ldiff
                list*
+               cddddr
+               cdddar
+               cddadr
+               cddaar
+               cdaddr
+               cdadar
+               cdaadr
+               cdaaar
+               cadddr
+               caddar
+               cadadr
+               cadaar
+               caaddr
+               caadar
+               caaadr
+               caaaar
+               cdddr
+               cddar
+               cdadr
+               cdaar
+               caddr
+               cadar
+               caadr
+               caaar
                tenth
                ninth
                eighth
@@ -373,7 +397,7 @@ lexical closures as in Common Lisp.
          (macroexpand-all
            `(cl-symbol-macrolet
                 ,(mapcar (lambda (x)
-                           `(,(car x) (symbol-value ,(caddr x))))
+                           `(,(car x) (symbol-value ,(nth 2 x))))
                          vars)
               ,@body)
           (cons (cons 'function #'cl--function-convert)
@@ -386,20 +410,20 @@ lexical closures as in Common Lisp.
         ;; dynamic scoping, since with lexical scoping we'd need
         ;; (let ((foo <val>)) ...foo...).
        `(progn
-           ,@(mapcar (lambda (x) `(defvar ,(caddr x))) vars)
-           (let ,(mapcar (lambda (x) (list (caddr x) (cadr x))) vars)
+           ,@(mapcar (lambda (x) `(defvar ,(nth 2 x))) vars)
+           (let ,(mapcar (lambda (x) (list (nth 2 x) (nth 1 x))) vars)
            ,(cl-sublis (mapcar (lambda (x)
-                              (cons (caddr x)
-                                    `',(caddr x)))
+                              (cons (nth 2 x)
+                                    `',(nth 2 x)))
                             vars)
                     ebody)))
       `(let ,(mapcar (lambda (x)
-                       (list (caddr x)
+                       (list (nth 2 x)
                              `(make-symbol ,(format "--%s--" (car x)))))
                      vars)
          (setf ,@(apply #'append
                         (mapcar (lambda (x)
-                                  (list `(symbol-value ,(caddr x)) (cadr x)))
+                                  (list `(symbol-value ,(nth 2 x)) (nth 1 x)))
                                 vars)))
          ,ebody))))
 
@@ -544,7 +568,7 @@ may be bound to temporary variables which are introduced
 automatically to preserve proper execution order of the arguments.
 For example:
 
-  (defsetf nth (n x) (v) `(setcar (nthcdr ,n ,x) ,v))
+  (defsetf nth (n x) (v) \\=`(setcar (nthcdr ,n ,x) ,v))
 
 You can replace this form with `gv-define-setter'.
 
@@ -602,6 +626,8 @@ You can replace this form with `gv-define-setter'.
 ;;     ...the rest, and build the 5-tuple))
 (make-obsolete 'get-setf-method 'gv-letplace "24.3")
 
+(declare-function cl--arglist-args "cl-macs" (args))
+
 (defmacro define-modify-macro (name arglist func &optional doc)
   "Define a `setf'-like modify macro.
 If NAME is called, it combines its PLACE argument with the other
@@ -615,6 +641,7 @@ You can replace this macro with `gv-letplace'."
                      symbolp &optional stringp)))
   (if (memq '&key arglist)
       (error "&key not allowed in define-modify-macro"))
+  (require 'cl-macs)                    ;For cl--arglist-args.
   (let ((place (make-symbol "--cl-place--")))
     `(cl-defmacro ,name (,place ,@arglist)
        ,doc