diff options
author | Kenichi Handa <handa@m17n.org> | 2010-09-27 14:42:43 +0900 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2010-09-27 14:42:43 +0900 |
commit | b3253cd4b4bcbe1ab4ad1fdc98b30c33af70332c (patch) | |
tree | 4d55005558f96dfb44bfcd746098ed0882aff2d0 /lisp/emacs-lisp/pcase.el | |
parent | 4be9765d4bad14d68cdfee2a2c6afe1001d9516a (diff) | |
parent | e5fa38990bca723fc3ef1d0ede792e8ff84b84f7 (diff) | |
download | emacs-b3253cd4b4bcbe1ab4ad1fdc98b30c33af70332c.tar.gz emacs-b3253cd4b4bcbe1ab4ad1fdc98b30c33af70332c.tar.bz2 emacs-b3253cd4b4bcbe1ab4ad1fdc98b30c33af70332c.zip |
merge trunk
Diffstat (limited to 'lisp/emacs-lisp/pcase.el')
-rw-r--r-- | lisp/emacs-lisp/pcase.el | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index b2b27a0e0d6..b922e0b0233 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -76,8 +76,8 @@ BODY should be an expression, and BINDINGS should be a list of bindings of the form (UPAT EXP)." (if (null bindings) body `(pcase ,(cadr (car bindings)) - (,(caar bindings) (plet* ,(cdr bindings) ,body)) - (t (error "Pattern match failure in `plet'"))))) + (,(caar bindings) (pcase-let* ,(cdr bindings) ,body)) + (t (error "Pattern match failure in `pcase-let'"))))) ;;;###autoload (defmacro pcase-let (bindings body) @@ -85,13 +85,14 @@ of the form (UPAT EXP)." BODY should be an expression, and BINDINGS should be a list of bindings of the form (UPAT EXP)." (if (null (cdr bindings)) - `(plet* ,bindings ,body) + `(pcase-let* ,bindings ,body) (setq bindings (mapcar (lambda (x) (cons (make-symbol "x") x)) bindings)) `(let ,(mapcar (lambda (binding) (list (nth 0 binding) (nth 2 binding))) bindings) - (plet* ,(mapcar (lambda (binding) (list (nth 1 binding) (nth 0 binding))) - bindings) - ,body)))) + (pcase-let* + ,(mapcar (lambda (binding) (list (nth 1 binding) (nth 0 binding))) + bindings) + ,body)))) (defun pcase-expand (exp cases) (let* ((defs (if (symbolp exp) '() |