all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Adam Porter <adam@alphapapa.net>
Cc: emacs-devel@gnu.org
Subject: Re: map.el: pcase plist keyword-only binding improvement
Date: Sun, 02 Feb 2020 08:46:31 -0500	[thread overview]
Message-ID: <jwvlfpl85vg.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <878sll2uu9.fsf@alphapapa.net> (Adam Porter's message of "Sun, 02 Feb 2020 03:37:34 -0600")

>     (seq-map (lambda (elt)
>                (cond ((consp elt)
>                       `(app (pcase--flip map-elt ,(car elt)) ,(cadr elt)))
>                      ((keywordp elt)
>                       ;; New clause for keyword-only elements.
>                       (let ((var (intern (substring (symbol-name elt) 1))))
>                         `(app (pcase--flip map-elt ,elt) ,var)))
>                      (t
>                       `(app (pcase--flip map-elt ',elt) ,elt))))
>              args))

Since binding the result of the match to a keyword can't work anyway,
this seems like a very good idea.

> Assuming that this change is acceptable, I would like to prepare a
> patch, which would probably need to include NEWS and documentation
> changes.

AFAICT we don't yet have actual documentation for the map.el package, so
only NEWS needs to be changed.

> However, since the change is to map.el rather than pcase.el,
> and since map.el is also available on ELPA,

It's also distributed via GNU ELPA indeed, but taken straight from the
emacs.git repository, so you don't need to worry about that (just
increment the `Version:` entry at the top).


        Stefan




  reply	other threads:[~2020-02-02 13:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-02  9:37 map.el: pcase plist keyword-only binding improvement Adam Porter
2020-02-02 13:46 ` Stefan Monnier [this message]
2020-02-02 16:38   ` Adam Porter
     [not found]     ` <874kw86dft.fsf@web.de>
2020-02-03 15:02       ` Nicolas Petton
2020-02-04 17:30     ` Stefan Monnier
2020-02-04 22:31       ` Adam Porter

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

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

  git send-email \
    --in-reply-to=jwvlfpl85vg.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=adam@alphapapa.net \
    --cc=emacs-devel@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.