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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Okam <okamsn@HIDDEN>; dated Sun, 4 Jul 2021 23:10:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 49407 <at> debbugs.gnu.org:


Received: (at 49407) by debbugs.gnu.org; 15 Jul 2021 08:52:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 15 04:52:08 2021
Received: from localhost ([127.0.0.1]:46786 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m3x6G-0002gY-Cb
	for submit <at> debbugs.gnu.org; Thu, 15 Jul 2021 04:52:08 -0400
Received: from quimby.gnus.org ([95.216.78.240]:54692)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1m3x6E-0002g0-Sm
 for 49407 <at> debbugs.gnu.org; Thu, 15 Jul 2021 04:52:07 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=ieIRdtq4XfPO0qi7o0efiXwFWlaFuuGaI6UsCsyB0GE=; b=UE9gmLTl98A7+P8U7u7fv3HuxU
 bW7Busj7Z/6nOc7sMOGwK3Bu8xAAxBqmwB/GumeG4KYD/aGG4Lb6q4AeCHr2ajt4E4aoCRys96FGe
 fPRlt2LZ2IcMkEStrZHUAXKgE3KTIP+MEioiiz847g4z+yETiwSy1Y628Xzb5LN+AJvk=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1m3x65-0006NX-VX; Thu, 15 Jul 2021 10:52:00 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Okam <okamsn@HIDDEN>
Subject: Re: bug#49407: Request: Specify default values in `map-let` in Map.el
References: <ba79f925-aa14-3d51-e888-7113e6cf09c4@HIDDEN>
X-Now-Playing: Bob Hund's _KlassiskBOBHUNkonsert_: "Reinkarnerad exact som
 =?utf-8?Q?f=C3=B6rut=22?=
Date: Thu, 15 Jul 2021 10:51:57 +0200
In-Reply-To: <ba79f925-aa14-3d51-e888-7113e6cf09c4@HIDDEN> (Okam's
 message of "Sun, 04 Jul 2021 23:08:55 +0000")
Message-ID: <87eec0klhu.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Okam <okamsn@HIDDEN> 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 argu [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 49407
Cc: Nicolas Petton <nicolas@HIDDEN>, 49407 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49407; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Jul 2021 23:09:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 04 19:09:44 2021
Received: from localhost ([127.0.0.1]:43370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m0BFA-0000Ft-5W
	for submit <at> debbugs.gnu.org; Sun, 04 Jul 2021 19:09:44 -0400
Received: from lists.gnu.org ([209.51.188.17]:48212)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <okamsn@HIDDEN>) id 1m0BF8-0000Fl-HF
 for submit <at> debbugs.gnu.org; Sun, 04 Jul 2021 19:09:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33184)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <okamsn@HIDDEN>)
 id 1m0BF8-00079i-11
 for bug-gnu-emacs@HIDDEN; Sun, 04 Jul 2021 19:09:42 -0400
Received: from mail-0201.mail-europe.com ([51.77.79.158]:53591)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <okamsn@HIDDEN>)
 id 1m0BF5-0002jo-PY
 for bug-gnu-emacs@HIDDEN; Sun, 04 Jul 2021 19:09:41 -0400
Date: Sun, 04 Jul 2021 23:08:55 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail; t=1625440142;
 bh=wcaKqNwwgwsj1RdEFdAqMUHyiqXoWBqNzmUNEG83wg8=;
 h=Date:To:From:Reply-To:Subject:From;
 b=Rij8S2pOkxKVNX3V8JYsSKXarTZwXSS0LORGJKVqMp+rkRXZgPW5m9kVHpbWfyx3w
 6ltR3e1SO+hhyy0vsVPsh3k5T0BziqAjd8BxZsRwNjKvXnaqNN40CSFSOzEsXZy2KF
 96Vg2hYbS122XvV1MSxmj5VTiVObEJZRuzTX6zkw=
To: bug-gnu-emacs@HIDDEN
From: Okam <okamsn@HIDDEN>
Subject: Request: Specify default values in `map-let` in Map.el
Message-ID: <ba79f925-aa14-3d51-e888-7113e6cf09c4@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED,
 DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no
 autolearn=disabled version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
 mailout.protonmail.ch
Received-SPF: pass client-ip=51.77.79.158; envelope-from=okamsn@HIDDEN;
 helo=mail-0201.mail-europe.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Okam <okamsn@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hello,

`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)))

or

     ;; More like Common Lisp arg-list for `&key'.
     (let ((map '(:a 1 :b 2)))
       (map-let ((:a a)
                 (:b b)
                 (:c (c 3)))
           map
         (+ a b c)))

Please consider adding this feature.

Thank you.






Acknowledgement sent to Okam <okamsn@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#49407; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 15 Jul 2021 09:00:01 UTC

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