GNU bug report logs - #50290
Using `setf` on `map-elt` repeats evaluation for returning the value of `setf`

Previous Next

Package: emacs;

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

Date: Tue, 31 Aug 2021 02:59:01 UTC

Severity: normal

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 50290 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Okamsn <okamsn <at> protonmail.com>
Cc: 50290 <at> debbugs.gnu.org
Subject: Re: bug#50290: Using `setf` on `map-elt` repeats evaluation for
 returning the value of `setf`
Date: Wed, 01 Sep 2021 10:33:10 +0200
Okamsn <okamsn <at> protonmail.com> writes:

> When I do `(setf (map-elt map key) (my-func))`, it expands to
>
>      (let* ((key key))
>        (condition-case nil
>            (with-no-warnings
>              (map-put! map key (my-func) nil))
>          (map-not-inplace
>           (setq map (map-insert map key (my-func)))
>           (my-func))))
>
> The repetition of `(my-func)` raises warnings. 

Yup.  This should now be fixed on the trunk.

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




This bug report was last modified 3 years and 348 days ago.

Previous Next


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