From: Stefan Monnier Date: Mon, 22 Sep 2014 18:22:02 +0000 (-0400) Subject: Add pcase-defmacro, as well as `quote' and `app' patterns. X-Git-Tag: emacs-25.0.90~2635^2~679^2~252 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6b33c17c85473d49a01f66f5ce2382d183ba079a;p=emacs.git Add pcase-defmacro, as well as `quote' and `app' patterns. * loadup.el: Increase max-lisp-eval-depth when macroexpanding macroexp. * emacs-lisp/pcase.el: Allow (F . ARGS) in `app' patterns. (pcase--funcall, pcase--eval): New functions. (pcase--u1): Use them for guard, pred, let, and app. (\`): Use the new feature to generate better code for vector patterns. * emacs-lisp/pcase.el: Use pcase-defmacro to handle backquote. (pcase--upat): Remove. (pcase--macroexpand): Don't hardcode handling of `. (pcase--split-consp, pcase--split-vector): Remove. (pcase--split-equal): Disregard ` since it's expanded away. (pcase--split-member): Optimize for quote rather than for `. (pcase--split-pred): Optimize for quote rather than for `. (pcase--u1): Remove handling of ` (and of `or' and `and'). Quote non-selfquoting values when passing them to `eq'. Drop `app's let-binding if the variable is not used. (pcase--q1): Remove. (`): Define as a pattern macro. * emacs-lisp/pcase.el (pcase--match): New smart-constructor function. (pcase--expand pcase--q1, pcase--app-subst-match): Use it. (pcase--macroexpand): Handle self-quoting patterns here, expand them to quote patterns. (pcase--split-match): Don't hoist or/and here any more. (pcase--split-equal): Optimize quote patterns as well as ` patterns. (pcase--flip): New helper macro. (pcase--u1): Optimize the memq case directly. Don't handle neither self-quoting nor and/or patterns any more. * emacs-lisp/pcase.el (pcase-defmacro): New macro. (pcase--macroexpand): New function. (pcase--expand): Use it. * emacs-lisp/pcase.el (pcase--app-subst-match, pcase--app-subst-rest): New optimization functions. (pcase--u1): Add support for `quote' and `app'. (pcase): Document them in the docstring. --- 6b33c17c85473d49a01f66f5ce2382d183ba079a diff --cc lisp/ChangeLog index 3fa8ca5a749,32806b24ea4..256ec813511 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@@ -1,3 -1,45 +1,40 @@@ + 2014-09-22 Stefan Monnier + - * loadup.el: Increase max-lisp-eval-depth while macroexpanding macroexp.el. - ++ Add pcase-defmacro, as well as `quote' and `app' patterns. ++ * loadup.el: Increase max-lisp-eval-depth when macroexpanding macroexp. + * emacs-lisp/pcase.el: Allow (F . ARGS) in `app' patterns. + (pcase--funcall, pcase--eval): New functions. + (pcase--u1): Use them for guard, pred, let, and app. + (\`): Use the new feature to generate better code for vector patterns. - + * emacs-lisp/pcase.el: Use pcase-defmacro to handle backquote. + (pcase--upat): Remove. + (pcase--macroexpand): Don't hardcode handling of `. + (pcase--split-consp, pcase--split-vector): Remove. + (pcase--split-equal): Disregard ` since it's expanded away. + (pcase--split-member): Optimize for quote rather than for `. + (pcase--split-pred): Optimize for quote rather than for `. + (pcase--u1): Remove handling of ` (and of `or' and `and'). + Quote non-selfquoting values when passing them to `eq'. + Drop `app's let-binding if the variable is not used. + (pcase--q1): Remove. + (`): Define as a pattern macro. - + * emacs-lisp/pcase.el (pcase--match): New smart-constructor function. + (pcase--expand pcase--q1, pcase--app-subst-match): Use it. + (pcase--macroexpand): Handle self-quoting patterns here, expand them to + quote patterns. + (pcase--split-match): Don't hoist or/and here any more. + (pcase--split-equal): Optimize quote patterns as well as ` patterns. + (pcase--flip): New helper macro. + (pcase--u1): Optimize the memq case directly. + Don't handle neither self-quoting nor and/or patterns any more. - + * emacs-lisp/pcase.el (pcase-defmacro): New macro. + (pcase--macroexpand): New function. + (pcase--expand): Use it. - - Add support for `quote' and `app'. + * emacs-lisp/pcase.el (pcase--app-subst-match, pcase--app-subst-rest): + New optimization functions. + (pcase--u1): Add support for `quote' and `app'. + (pcase): Document them in the docstring. + 2014-09-22 Stefan Monnier Use lexical-bindin in Ibuffer.