From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Federico Tedin Newsgroups: gmane.emacs.bugs Subject: bug#62020: Lisp reader: dotted pair notation not working when initial elements are omitted Date: Tue, 7 Mar 2023 18:24:32 +0100 Message-ID: References: <838rg87me0.fsf@gnu.org> <3242578A-C50A-4195-B663-F52B05DD80F6@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16316"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62020@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 07 18:25:10 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZb3m-0003zo-Fh for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Mar 2023 18:25:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZb3h-0005QN-GW; Tue, 07 Mar 2023 12:25:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZb3f-0005QC-7X for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2023 12:25:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZb3e-0000So-RN for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2023 12:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZb3e-0004Cy-96 for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2023 12:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Federico Tedin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Mar 2023 17:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62020 X-GNU-PR-Package: emacs Original-Received: via spool by 62020-submit@debbugs.gnu.org id=B62020.167820989116155 (code B ref 62020); Tue, 07 Mar 2023 17:25:02 +0000 Original-Received: (at 62020) by debbugs.gnu.org; 7 Mar 2023 17:24:51 +0000 Original-Received: from localhost ([127.0.0.1]:47123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZb3T-0004CV-67 for submit@debbugs.gnu.org; Tue, 07 Mar 2023 12:24:51 -0500 Original-Received: from mail-pl1-f179.google.com ([209.85.214.179]:44771) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZb3R-0004CG-OV for 62020@debbugs.gnu.org; Tue, 07 Mar 2023 12:24:50 -0500 Original-Received: by mail-pl1-f179.google.com with SMTP id a9so14858461plh.11 for <62020@debbugs.gnu.org>; Tue, 07 Mar 2023 09:24:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678209883; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6DT/2jUHJ2oDUjWOaKu3PRBbB0ZHFXdlQuvDCDAj78U=; b=ESwB/t3nW0kMFpScLzd4JUKSsG3qV6MQn2v38rdM3cAWVAdDE53zhriBNBFP5TJjo0 soRfdMCyGXX12wjTavA9eCIT5irWBNGEOoEYKfw8yPDCkXPG8NF/ziuUYFxuEdAZRfvY bXYu1uWHZO+SeHwnRm8bfHevqP1X4nA1PkJEl2gHuxUpjV93/drWbZNZZV0eiykFMcQQ kmif5VO3eP66mMdbHZUsG6WZqW+8M4tLuABV+KpG/hqzcty3H6t2ynaqABoWutRQQphu Cm03kq1v10VK6/yN0dfRL6HJtAW/KWBw6R310U5D/4AjZ25BqDseutLW7jnagk1ieHlE o4zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678209883; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6DT/2jUHJ2oDUjWOaKu3PRBbB0ZHFXdlQuvDCDAj78U=; b=nZGiwesSSEZ457hPlyPfdUwArRe18E/fBzXMU0VlUOUDRowI+/t9+LOLOoH6gP3v59 F4LrQZ7k55d1Gd/YsPW51rMZvDgf2zR6UKDGorlDS0SG5v5mqHqzYtZjUJ9n7ja5OoDp TlHS3DBRCVzgS9oB/6KXq2HDCvTqcMx/IWBnsETSyzCtpYOOhlfbgdKT4qQc/grNWUUc UD27rEI3SUC038rtUPTcHZBrPzSytWpaC4ja+7/cgQNLjPFzF6cvv+zKRwUsRrqI1jXW 89lbOJs5Noa6gR7RMnWvvP6r20f0Jln4Bkhs5RONRWSSJErPUOC1dQ7Tn8EAhyndOU+j jJ3Q== X-Gm-Message-State: AO0yUKV+7te7QEYf6OrNap1ObqrCv2AW5rClaMPNzsBsLEvplsz3olKx 57niMbRHN52aaedEHtZ70DRcaoNn8XD6d+gjXR8= X-Google-Smtp-Source: AK7set+7rKWOcUNf2FMP5guJg4TDWe+dpoDN5CM6AhNwqTdreVj06YBrTwcNUYtH+kBz6OIxPR4QivmUrQTwppfXe1c= X-Received: by 2002:a17:903:31d5:b0:19a:f9d9:28d4 with SMTP id v21-20020a17090331d500b0019af9d928d4mr5871057ple.3.1678209883510; Tue, 07 Mar 2023 09:24:43 -0800 (PST) In-Reply-To: <3242578A-C50A-4195-B663-F52B05DD80F6@acm.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:257491 Archived-At: > Federico, it would be very easy to change the reader into behaving that w= ay and I'll do that if required, but before I or anyone else change code or= docs, and above all much more important and interesting would be to hear e= xactly why it matters to you and how you were affected by this corner of th= e reader semantics. > Could be it that you saw the manual passage, decided to try it out -- whi= ch is good, we want more people to do that -- and observed that Emacs and t= he manual didn't agree on that point? > As far as I can tell while researching ahead of the previous changed, the= documented (old) reader semantics was merely emergent behaviour of an unde= r-constrained implementation, never a purposeful design for user convenienc= e. > No other Lisp (Common Lisp, Scheme etc) implementation known to me provid= es such a reader 'feature', and no evidence of any use of it was found at t= he time. This is why your report is of such interest: did it actually break= existing code, and if so, how exactly? Hey Mattias. The reason I found this is actually a bit funny. I am working on re-implementing the Elisp interpreter (and other parts of Emacs) in Go, as a hobby/learning/fun project. My initial implementation of the reader was based on the old version of Emacs' reader (i.e. with read0 and read1 calling each other). Recently I decided to port over the changes made to the Emacs reader (nonrecursive reader), and immediately after I finished, I ran my test suite and realized that some cases were failing. All of them were related to the trailing dot notation, specifically when the initial elements were omitted. The project itself can be found here (https://github.com/federicotdn/pimacs), the reader is in read.go and the test cases in interpreter_test.go. I implemented a fix in my code in order to still be able to read these expressions (though it's a bit ugly at the moment). I agree that using the (. x) notation is not really needed, I haven't used it in any of my code myself. And specially if no other Lisp implements it, it would make sense to consider its removal! Though I am not sure how these types of changes are handled in Emacs.