From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#35546: 27.0.50; setf return value for new alist entries is wrong Date: Tue, 07 May 2019 17:56:50 +0200 Message-ID: <8736lqmf5p.fsf@web.de> References: <87lfznzm08.fsf@gnu.org> <87ftpqmrz9.fsf@web.de> <878svimlbz.fsf@web.de> <85zhnyxqey.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="21585"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35546@debbugs.gnu.org, Tassilo Horn To: npostavs@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 07 17:58:49 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hO2UT-0005Vj-Bh for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 May 2019 17:58:49 +0200 Original-Received: from localhost ([127.0.0.1]:49076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO2US-0002b8-DM for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 May 2019 11:58:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO2Tl-0002HU-8T for bug-gnu-emacs@gnu.org; Tue, 07 May 2019 11:58:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hO2Tj-0006AW-6n for bug-gnu-emacs@gnu.org; Tue, 07 May 2019 11:58:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45845) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hO2Ti-0006AC-EY for bug-gnu-emacs@gnu.org; Tue, 07 May 2019 11:58:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hO2Ti-0005Gj-6l for bug-gnu-emacs@gnu.org; Tue, 07 May 2019 11:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 May 2019 15:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35546 X-GNU-PR-Package: emacs Original-Received: via spool by 35546-submit@debbugs.gnu.org id=B35546.155724462220153 (code B ref 35546); Tue, 07 May 2019 15:58:02 +0000 Original-Received: (at 35546) by debbugs.gnu.org; 7 May 2019 15:57:02 +0000 Original-Received: from localhost ([127.0.0.1]:59387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hO2Sk-0005Ez-9L for submit@debbugs.gnu.org; Tue, 07 May 2019 11:57:02 -0400 Original-Received: from mout.web.de ([212.227.15.4]:56545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hO2Si-0005EU-MM for 35546@debbugs.gnu.org; Tue, 07 May 2019 11:57:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1557244612; bh=dH98oWDbp46yehBXvEz6NGErL8kxd20TymnPotRbUGI=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=XClbxs998GMIjIOnP30xqspqlEt80DR8e5D0sPUvfgpVxZEUsrhJmglh1MsMYrNkp 8mJtyZXvGXbKxaMtvsmDeTnfW1yjtpn/9Wief4OKU4uoLiPvnsvrsWybHco/xFy4z8 rkunhPKxTI8Z01hK7wof/6/io8KQdM8ywkWJ7/As= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([88.66.186.107]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MUEoU-1hFoyv3ST4-00R1Yq; Tue, 07 May 2019 17:56:51 +0200 In-Reply-To: <85zhnyxqey.fsf@gmail.com> (npostavs@gmail.com's message of "Tue, 07 May 2019 10:58:13 -0400") X-Provags-ID: V03:K1:bUFLFWtoTICANg8OJd+eZ5/485M6A0CnYmPQz16he51y6xXg6EY K3HP9cEDTy0JxkPhqXqzgiU4vU6X+mz5LAMG3ub4RaqZ+v8JPkmv3bTvYwH9HYauXIavJxP Oc0nVip8xcPeuTu/wmYB0HiP21qdmUO+jPZrpY/s5W+sqEQHRaQkORw+KSoFddnfyzTB2GB e8HwLAqwdvibuFlhSmfPQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:vjVdusOM+Bs=:TRshMuIxaJ2+8oupygztCL ijEHQYQVpFHzshXYrU0ejcEKsAi7bNmWsId+OBB7/7dN6jpP+Ykk2lmZhtZGBBVT/bB3hX1fd 7jyqx4tROp6IOwYy8xEvMyArIbs5DxJj8HekfTc0GSN05Z7O1//NA2TDpLWZwr79lUZzwVfTJ i51bClYYSYqur3eWyY+ENZTeyr4cyDsei7o89cD/FV6M5SjxCwjk8kwnhZOAfVBhQK+U/C40U TP69vu9mCMKAnTS9A1EDje/DZ80LY7Ui0KHn9djUCqFEXgufdqMSseK3X8QKiAqrQ71Y9HCrQ ZnvDcjkonWym0yKe+zOP/Bp7Fjdj3GkWzmMzeCpKyiQDWPyKYmPjyUEnVn8KmmgD/TdlvSXjs bsW/SdBDuX7Y7LeJEGjoxPOskB9qvnBImyQmvsEKKllAuFR8lywRz7bI1H6p8iAYZfmGNrED/ HfbBQandrGKfItje5eMwBmLSdqch+LGsgGi7bopOfgIRHlVJg3xjfSDMEOAXZlGBVe344T4gP HJitEE2/kO1MiBQJRmAdaGrIYYPW3VJjqOdukSQrH9mVLLDMOX55hMGfIFbrNReTm9z508P5f iZz5Qg5+2muzQDzG5Ua14AsomXoKJoag14wFCn7797PCyUaxJ+rqIT1kM699qD69fRpahHjwP ymK4yj003iI3SdkX8dkY7a2z+BDpnHzFdUP89LDuGDFlUTCIutSnRj3p//FxKAJDcu+zKptfn C2d2ilaO+/pqeKJ5xOrW7wUxYPj0p4fyIAjid5TFkKo0q4cGWWeAbKRj67eF9s+0eAaN3ZpB X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158877 Archived-At: npostavs@gmail.com writes: > I think the rationale goes like this: > > Suppose you want to *get* the bottom 4 bits of PLACE, you do > > (logand PLACE #x0F) > > ;; Example: > (let ((var #xABCD)) > (logand var #x0F)) ;=> #xD > > Suppose you want to *set* the bottom 4 bits of PLACE, you do > > (setf (logand PLACE #x0F) VALUE) > > ;; Example: > (let ((var #xABCD)) > (setf (logand var #x0F) 9) > var) ;=> #xABC9 Ah, ok, thanks. So, from all solutions it takes that one with the least changes to the bits of PLACE. If the setter code would be more like (funcall setter `(logif ,mask ,v ,getter)) it would be better readable, with the disadvantage that it would not work any more. Anyway, there is no reason that the setter currently does not return V, right? Thanks, Michael.