From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vasilij Schneidermann Newsgroups: gmane.lisp.guile.bugs Subject: bug#47550: [PATCH] elisp mode doesn't support non-list argument lists Date: Thu, 1 Apr 2021 18:18:21 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3/c6/I9c63BJzxhK" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11598"; mail-complaints-to="usenet@ciao.gmane.io" To: 47550@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Thu Apr 01 18:19:08 2021 Return-path: Envelope-to: guile-bugs@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 1lS02F-0002t5-Fp for guile-bugs@m.gmane-mx.org; Thu, 01 Apr 2021 18:19:07 +0200 Original-Received: from localhost ([::1]:55598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lS02E-0001rg-CX for guile-bugs@m.gmane-mx.org; Thu, 01 Apr 2021 12:19:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lS02A-0001rZ-8r for bug-guile@gnu.org; Thu, 01 Apr 2021 12:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46872) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lS02A-0005Xk-1O for bug-guile@gnu.org; Thu, 01 Apr 2021 12:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lS029-0004bs-Sm for bug-guile@gnu.org; Thu, 01 Apr 2021 12:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vasilij Schneidermann Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 01 Apr 2021 16:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47550 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161729391717675 (code B ref -1); Thu, 01 Apr 2021 16:19:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Apr 2021 16:18:37 +0000 Original-Received: from localhost ([127.0.0.1]:58418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lS01k-0004b1-TI for submit@debbugs.gnu.org; Thu, 01 Apr 2021 12:18:37 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lS01j-0004ar-2W for submit@debbugs.gnu.org; Thu, 01 Apr 2021 12:18:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lS01i-0001ql-Tg for bug-guile@gnu.org; Thu, 01 Apr 2021 12:18:34 -0400 Original-Received: from mout-p-202.mailbox.org ([2001:67c:2050::465:202]:60140) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1lS01g-00059o-P2 for bug-guile@gnu.org; Thu, 01 Apr 2021 12:18:34 -0400 Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4FB7ds5kbczQk1m for ; Thu, 1 Apr 2021 18:18:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id es4w1GZecBSK for ; Thu, 1 Apr 2021 18:18:22 +0200 (CEST) Content-Disposition: inline X-Rspamd-Score: -6.99 / 15.00 / 15.00 X-Rspamd-Queue-Id: CC76016F2 X-Rspamd-UID: d977c5 Received-SPF: pass client-ip=2001:67c:2050::465:202; envelope-from=mail@vasilij.de; helo=mout-p-202.mailbox.org X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10006 Archived-At: --3/c6/I9c63BJzxhK Content-Type: multipart/mixed; boundary="iXVoRSAvImT/v7j/" Content-Disposition: inline --iXVoRSAvImT/v7j/ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline When I've tried porting existing elisp code, I've found that `(defun foo nil 1)` errors out (on Guile 3 and master) , but `(defun foo () 1)` doesn't. The following patch rectifies this by treating `nil` the same as `()` when compiling a lambda. --iXVoRSAvImT/v7j/ Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-elisp-Handle-nil-argument-list.patch" Content-Transfer-Encoding: quoted-printable =46rom f3a7bd452e476f5769972ab2cac6da1cf4997c4f Mon Sep 17 00:00:00 2001 =46rom: Vasilij Schneidermann Date: Thu, 1 Apr 2021 18:05:07 +0200 Subject: [PATCH] elisp: Handle nil argument list * module/language/elisp/compile-tree.scm (parse-lambda-list): Handle nil the same as (). --- module/language/elisp/compile-tree-il.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/module/language/elisp/compile-tree-il.scm b/module/language/el= isp/compile-tree-il.scm index 0334e6f33..adbeb2005 100644 --- a/module/language/elisp/compile-tree-il.scm +++ b/module/language/elisp/compile-tree-il.scm @@ -259,6 +259,7 @@ (define (%match lst null optional rest symbol) (pmatch lst (() (null)) + (nil (null)) ((&optional . ,tail) (optional tail)) ((&rest . ,tail) (rest tail)) ((,arg . ,tail) (guard (symbol? arg)) (symbol arg tail)) --=20 2.31.1 --iXVoRSAvImT/v7j/-- --3/c6/I9c63BJzxhK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEE0dAcySl3bqM8O17WFmfJg6zCifoFAmBl8kUACgkQFmfJg6zC ifrH6Qf7B1r82LgREK4VqfQ6hkWT4O8dWrJ6A36HUoT5diSNS+P1K2vKGyiNl8rw RXPPbRx4EkD7uAUq8l2OMTqajDTzK5jlfimU6UIseVfrDjRM2B1cZ92zZ39jJsJu ca0uWC4tH76fVWURJOBPw8/cpeSn2aEa9B5Mf1vCl5pzaWm0DwuGe8Uc7k8mznEp XmnKrJe4in2vb/jdkJ99BKw5pvyK9AVSLyLpiTcbkuMcPHLELDeE7AxN5wjpejqh VShbHJ3nXiO8W+MQQ8AbZ07In1EmtIcPWejMDG6SBFB+vdi9Euqzw4bfJxPhciVS IotR4/4jNjLARbaiR7L8ou74XhgtRA== =xTpt -----END PGP SIGNATURE----- --3/c6/I9c63BJzxhK--