unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: johnw@gnu.org, emacs-devel@gnu.org
Subject: Re: Update of pcase docs for the elisp manual
Date: Thu, 28 Jan 2016 19:37:50 +0100	[thread overview]
Message-ID: <8760ydbldt.fsf@web.de> (raw)
In-Reply-To: <83bn8939go.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 25 Jan 2016 18:33:27 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

> I understand.  I'm just saying that it would be better to provide an
> example of using 'let' which actually made use of the reason for its
> introduction: binding symbols to values.

It's not easy to find an example for a usage of the let pattern that is
not too complicated and can't be replaced trivially with other patterns,
and does also make at least a bit of sense.

I maybe would suggest something like this:

--8<---------------cut here---------------start------------->8---
(pcase some-list
  ((and (let value (calculate-some-value))
        (or (pred (member  value))
            (pred (assoc   value))))
   value))
--8<---------------cut here---------------end--------------->8---

This tests some-list whether - for a VALUE calculated and bound in a let
pattern, whether either this VALUE is a member of the argument list, or
a key in it interpreted as an alist.  If it is, that value is returned.


How is the state of the documentation now?  Do you need some more
contributions, or should I proofread everything?


Regards,

Michael.



  reply	other threads:[~2016-01-28 18:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2fuxq6pb0.fsf@newartisans.com>
     [not found] ` <87d1stznc6.fsf@web.de>
     [not found]   ` <m2si1p8r31.fsf@newartisans.com>
     [not found]     ` <m2powt5w50.fsf@newartisans.com>
2016-01-23 11:17       ` Update of pcase docs for the elisp manual Eli Zaretskii
2016-01-24  4:40         ` Stefan Monnier
2016-01-24 14:33           ` Eli Zaretskii
2016-01-24 23:17             ` Stefan Monnier
2016-01-25 16:14               ` Eli Zaretskii
2016-01-26  1:40                 ` Stefan Monnier
2016-01-26 15:38                   ` Eli Zaretskii
2016-01-26 16:23                     ` Stefan Monnier
2016-01-25 14:22             ` Michael Heerdegen
2016-01-25 14:15         ` Michael Heerdegen
2016-01-25 16:33           ` Eli Zaretskii
2016-01-28 18:37             ` Michael Heerdegen [this message]
2016-01-29  3:06               ` Stefan Monnier
2016-01-29  9:45               ` Eli Zaretskii
2016-01-29 14:51                 ` Michael Heerdegen
2016-01-26 16:59         ` John Wiegley
2016-01-26 18:10           ` Stefan Monnier
2016-01-26 18:41           ` Eli Zaretskii
2016-01-26 19:35             ` John Wiegley
2016-01-26 20:28               ` Eli Zaretskii
2016-01-29  1:28                 ` John Wiegley
2016-01-29  8:30                   ` Eli Zaretskii
2016-01-29 13:39                     ` Andy Moreton
2016-01-29 14:21                       ` Eli Zaretskii
2016-01-29 15:14                         ` Andy Moreton
2016-01-29 15:37                           ` Eli Zaretskii
2016-01-26 19:58             ` Andy Moreton
2016-01-26 20:19               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760ydbldt.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=johnw@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).