GNU bug report logs - #49407
Request: Specify default values in `map-let` in Map.el

Previous Next

Package: emacs;

Reported by: Okam <okamsn <at> protonmail.com>

Date: Sun, 4 Jul 2021 23:10:01 UTC

Severity: wishlist

Fixed in version 30.1

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Okam <okamsn <at> protonmail.com>
Cc: Nicolas Petton <nicolas <at> petton.fr>, 49407 <at> debbugs.gnu.org
Subject: bug#49407: Request: Specify default values in `map-let` in Map.el
Date: Thu, 15 Jul 2021 10:51:57 +0200
Okam <okamsn <at> protonmail.com> writes:

> `map-let` allows one to conveniently bind variables using `map-elt`, but
> does not provide a way specify a default value if a key is missing.
>
> With `map-elt`, one can use the optional third argument to specify this
> value.  It would be good to have this in `map-let` as well.
>
> For example, maybe it could look something like
>
>      ;; As just a third value in the list:
>      (let ((map '(:a 1 :b 2)))
>        (map-let ((:a a)
>                  (:b b)
>                  (:c c 3))
>            map
>          (+ a b c)))

Hm...  I guess that could be useful.  I've added Nicolas to the CCs;
perhaps he has an opinion here.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 2 years and 2 days ago.

Previous Next


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