GNU bug report logs - #13126
24.3.50; (WISH) Document pcase in Info manual

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Sun, 9 Dec 2012 09:27:01 UTC

Severity: minor

Merged with 12752

Found in version 24.3.50

Fixed in version 24.3

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 13126 <at> debbugs.gnu.org
Subject: bug#13126: 24.3.50; (WISH) Document pcase in Info manual
Date: Tue, 11 Dec 2012 15:50:42 +0530
>> 24.3.50; Document pcase in Info manual
>
> I just installed a doc for it in the `emacs-24' branch.  Please take
> a look at it,

Thanks.  `pcase' seemed a good replacement for `case'.

Quick feedback.

1. pcase-let, pcase-let*, pcase-dolist (maybe)

2. It took some effort to understand that there is a U-PATTERN and a
   UPATTERN.  We don't read out `*-*', do we?

    ,----
    |    There are two kinds of patterns involved in `pcase', called
    | _U-patterns_ and _Q-patterns_.  The UPATTERN mentioned above are
    | U-patterns and can take the following forms:
    `----

3. Let's take the example of how

    ,----
    | (defun evaluate (exp env)
    |   (pcase exp
    | ,----
    | |     (`(add ,x ,y)         (+ (evaluate x env) (evaluate y env)))
    | `----
    |     (`(call ,fun ,arg)    (funcall (evaluate fun) (evaluate arg env)))
    |     (`(fn ,arg ,body)     (lambda (val)
    |                             (evaluate body (cons (cons arg val) env))))
    |     ((pred numberp)       exp)
    |     ((pred symbolp)       (cdr (assq exp env)))
    |     (_                    (error "Unknown expression %S" exp))))
    `----

             `(add ,x ,y)


        `   QPATTERN
                




This bug report was last modified 12 years and 112 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.