From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: npostavs@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#35546: 27.0.50; setf return value for new alist entries is wrong Date: Tue, 07 May 2019 10:58:13 -0400 Message-ID: <85zhnyxqey.fsf@gmail.com> References: <87lfznzm08.fsf@gnu.org> <87ftpqmrz9.fsf@web.de> <878svimlbz.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="21457"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) Cc: 35546@debbugs.gnu.org, Tassilo Horn To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 07 16:59:16 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 1hO1Yo-0005S0-NH for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 May 2019 16:59:14 +0200 Original-Received: from localhost ([127.0.0.1]:48144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1Yn-0003ei-Nw for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 May 2019 10:59:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1Yd-0003eW-TB for bug-gnu-emacs@gnu.org; Tue, 07 May 2019 10:59:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hO1Yd-0000BJ-0n for bug-gnu-emacs@gnu.org; Tue, 07 May 2019 10:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45776) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hO1Yc-0000BD-UK for bug-gnu-emacs@gnu.org; Tue, 07 May 2019 10:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hO1Yc-0003gE-D0 for bug-gnu-emacs@gnu.org; Tue, 07 May 2019 10:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 May 2019 14:59: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.155724110214091 (code B ref 35546); Tue, 07 May 2019 14:59:02 +0000 Original-Received: (at 35546) by debbugs.gnu.org; 7 May 2019 14:58:22 +0000 Original-Received: from localhost ([127.0.0.1]:59320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hO1Xx-0003fD-SX for submit@debbugs.gnu.org; Tue, 07 May 2019 10:58:22 -0400 Original-Received: from mail-it1-f174.google.com ([209.85.166.174]:55369) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hO1Xx-0003ez-3h for 35546@debbugs.gnu.org; Tue, 07 May 2019 10:58:21 -0400 Original-Received: by mail-it1-f174.google.com with SMTP id q132so11696165itc.5 for <35546@debbugs.gnu.org>; Tue, 07 May 2019 07:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=h+gpotZ2h/F3yzWahMFvjamAZRQWa21/OgTCik9v6Co=; b=RBZhHz3WTVcUn6CpBakosL1NtiuwpSCXmmxv4qnxPSeLNfmv6wHzotx85lWDhwr7QS RYvCy+UevqUElJ+nuYzFoLUhh0OlMR28Oo+fxFRrnehGSOWQpnOMqk4UFSxCdktzYfyc 1a9O/sWd8FoaXc0R0IVlBX4hMpKo5SnbBvunxIrl4Bq2opZLIQ23hvAsRVchpk6NUNjI mfDz4ufqaMkK1pmoErinLKIrpycyAE3pzQ6RuwMdOnK/LRSYAtWgPBrkUkewACfTorPm OyyW0rhxhCBDsmDBifI8AHq7WepnatZWpO1K9GODsTESScOqKrQ4gVDLjVWH7bk3XQHa d/9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=h+gpotZ2h/F3yzWahMFvjamAZRQWa21/OgTCik9v6Co=; b=GKl5Ixk0s9iFKtVeGNm7mlRlEaX7E/rWIvtLbXQJHzk8q0bCQD0AktRMbUgX5GdhDm +RaK3cCcD7+2zRoGHoo/Q6tDjD2Vy0hCGse5BJWO28cQYe4N0x6M/0Vioi6nCLR+7ZBb dlmQHE+15ckpiEn0AhNNNJDVFvruIhCxu4KpOoAe5XMlBSIzRnKL5a2JBdrdl9MT8dLj e/URB1unAItPjFrLlFv+qwLtnsxsDt6y9D7uJ/G62sqpS53IP6haC8N4kc5x3S5qQEJc fO7wRRtxup0Ge7uMQ98gSaQD4gZ+1UZ5D4zLjOcWwHcNravmCxWu0Yr3I0chYuJzcJ99 UREw== X-Gm-Message-State: APjAAAXqhNC3aZH/WfpNo6LMlPYLqp8Hu2AYHFrnuI67bW14/FcttEHQ FT+n3Q3dhyUTjLcgQtahdj5l4hjP X-Google-Smtp-Source: APXvYqwQfud6ZU4rHaIuxUJH01wYFd0wpm+qt+YWCGzx4aVTqzGWmDk9iiv32Ic14IEVZVnz5KIKTg== X-Received: by 2002:a24:6292:: with SMTP id d140mr21767723itc.12.1557241094455; Tue, 07 May 2019 07:58:14 -0700 (PDT) Original-Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id i203sm6297098iti.7.2019.05.07.07.58.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 May 2019 07:58:13 -0700 (PDT) In-Reply-To: <878svimlbz.fsf@web.de> (Michael Heerdegen's message of "Tue, 07 May 2019 15:43:28 +0200") 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:158876 Archived-At: Michael Heerdegen writes: > struggling with 'logand', because I don't understand what it is doing. > Not only that "it should arguably fail when trying to set a value > outside of the mask" as described in the file header, I also don't see > how the used formula makes more sense than setting the place to just V. 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