Commit 801eda8a authored by Stefan Monnier's avatar Stefan Monnier

* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): Optimize &aux.

Rework to avoid cl--do-arglist in more cases; add comments to explain what's
going on.
(cl--do-&aux): New function extracted from cl--do-arglist.
(cl--do-arglist): Use it.
* lisp/emacs-lisp/cl-generic.el: Add Version: header, for ELPA purposes.
parent f925fc93
2015-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/cl-macs.el (cl--transform-lambda): Rework to avoid
cl--do-arglist in more cases; add comments to explain what's going on.
(cl--do-&aux): New function extracted from cl--do-arglist.
(cl--do-arglist): Use it.
* emacs-lisp/cl-generic.el: Add Version: header, for ELPA purposes.
* obsolete/iswitchb.el (iswitchb-read-buffer): Add `predicate' arg.
* isearchb.el (isearchb-iswitchb): Adjust accordingly.
* ido.el (ido-read-buffer): Add `predicate' argument.
......
......@@ -3,6 +3,7 @@
;; Copyright (C) 2015 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Version: 1.0
;; This file is part of GNU Emacs.
......
This diff is collapsed.
......@@ -427,4 +427,21 @@
(ert-deftest cl-flet-test ()
(should (equal (cl-flet ((f1 (x) x)) (let ((x #'f1)) (funcall x 5))) 5)))
(ert-deftest cl-lib-test-typep ()
(cl-deftype cl-lib-test-type (&optional x) `(member ,x))
;; Make sure we correctly implement the rule that deftype's optional args
;; default to `*' rather than to nil.
(should (cl-typep '* 'cl-lib-test-type))
(should-not (cl-typep 1 'cl-lib-test-type)))
(ert-deftest cl-lib-arglist-performance ()
;; An `&aux' should not cause lambda's arglist to be turned into an &rest
;; that's parsed by hand.
(should (eq () (nth 1 (nth 1 (macroexpand
'(cl-function (lambda (&aux (x 1)) x)))))))
(cl-defstruct (cl-lib--s (:constructor cl-lib--s-make (&optional a))) a)
;; Similarly the &cl-defs thingy shouldn't cause fallback to manual parsing
;; of args if the default for optional args is nil.
(should (equal '(&optional a) (help-function-arglist 'cl-lib--s-make))))
;;; cl-lib.el ends here
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment