unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Nathan Moreau <nathan.moreau@m4x.org>
Cc: Drew Adams <drew.adams@oracle.com>,
	Emacs Development <emacs-devel@gnu.org>
Subject: Re: pcase-if-let?
Date: Tue, 17 Apr 2018 23:04:56 +0200	[thread overview]
Message-ID: <87r2nd8ryf.fsf@web.de> (raw)
In-Reply-To: <CADDcBWXo_f8_KHtOUNYF8hVUwkGDtYNT7RMgS6mBvxDrwN1MhQ@mail.gmail.com> (Nathan Moreau's message of "Tue, 17 Apr 2018 22:26:41 +0200")

Nathan Moreau <nathan.moreau@m4x.org> writes:

> (pcase-if
>     ((`(,q . ,r) '())
>      (`(,s . ,u) '(b c)))
>     (list q r s u 'ok)
>   'nope)
> =>  nil
>
>
> ?
> I would have expected 'nope instead.

Sure, good catch.  There's a catchall rule missing in my implementation
that evaluates the else forms when matching fails (like above).

A better implementation would probably more look like that of
`pcase-let*'.  Seems I already get something like pcase-if when I change
the pcase--dontcare rule in `pcase--let*'.


Thanks,

Michael.



      reply	other threads:[~2018-04-17 21:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 23:20 pcase-if-let? Michael Heerdegen
2018-03-28 23:54 ` pcase-if-let? Davis Herring
2018-03-29  0:21   ` pcase-if-let? Michael Heerdegen
2018-03-29  3:46     ` pcase-if-let? Michael Heerdegen
2018-03-29  4:14       ` pcase-if-let? Drew Adams
2018-03-29  4:39         ` pcase-if-let? Michael Heerdegen
2018-03-29  4:49           ` pcase-if-let? Drew Adams
2018-03-29  4:53           ` pcase-if-let? Stefan Monnier
2018-03-29  5:24             ` pcase-if-let? Michael Heerdegen
2018-03-29 11:59               ` pcase-if-let? Stefan Monnier
2018-03-30  1:52                 ` pcase-if-let? Michael Heerdegen
2018-03-30  4:07                   ` pcase-if-let? Drew Adams
2018-03-30  5:09                     ` pcase-if-let? Michael Heerdegen
2018-03-30 15:07                       ` pcase-if-let? Drew Adams
2018-03-30 23:22                         ` pcase-if-let? Michael Heerdegen
2018-04-17 20:26           ` pcase-if-let? Nathan Moreau
2018-04-17 21:04             ` Michael Heerdegen [this message]

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=87r2nd8ryf.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=nathan.moreau@m4x.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).