bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Lars Ingebrigtsen
Subject: bug#49407: Request: Specify default values in `map-let` in Map.el
Date: Thu, 15 Jul 2021 10:51:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Okam <okamsn@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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]