From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Timothy Sample Newsgroups: gmane.lisp.guile.bugs Subject: bug#65132: [PATCH] fix cond1 macro Date: Mon, 07 Aug 2023 14:15:47 -0600 Message-ID: <87bkfitxqk.fsf@ngyro.com> References: 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="12453"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: 65132@debbugs.gnu.org To: Ekaitz Zarraga Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Mon Aug 07 22:17:25 2023 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 1qT6fL-000314-V1 for guile-bugs@m.gmane-mx.org; Mon, 07 Aug 2023 22:17:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qT6f6-0003wy-AI; Mon, 07 Aug 2023 16:17:08 -0400 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 1qT6f0-0003wa-6Z for bug-guile@gnu.org; Mon, 07 Aug 2023 16:17:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qT6ez-0006dn-UR for bug-guile@gnu.org; Mon, 07 Aug 2023 16:17:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qT6ez-0000W5-PC for bug-guile@gnu.org; Mon, 07 Aug 2023 16:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Timothy Sample Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 07 Aug 2023 20:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65132 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Original-Received: via spool by 65132-submit@debbugs.gnu.org id=B65132.16914393631913 (code B ref 65132); Mon, 07 Aug 2023 20:17:01 +0000 Original-Received: (at 65132) by debbugs.gnu.org; 7 Aug 2023 20:16:03 +0000 Original-Received: from localhost ([127.0.0.1]:34467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qT6e3-0000Um-IU for submit@debbugs.gnu.org; Mon, 07 Aug 2023 16:16:03 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:36711) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qT6dz-0000Tw-7b for 65132@debbugs.gnu.org; Mon, 07 Aug 2023 16:16:02 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 1FC3E3200934; Mon, 7 Aug 2023 16:15:51 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 07 Aug 2023 16:15:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ngyro.com; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1691439350; x=1691525750; bh=c2fZJd/sK/UTjHBs3rbOyYwIFUVe3ySFg+P tp2lSbVk=; b=aw4VjypDuqFRkjemsLIIPjeC31hWnBAeCRVGYOi38imKpnW4av5 m3D8XzGtH9DYrWn2Nl3xgtUBf2D9EzDCTWghtA22NHZeOPk7TwL9LVTwXaRyTBxp iVFjaEMJ9S46cKbpvPaVandVs/o4cirvSYiiOqPMlFdyTopaRrz0HHzLKs2TLljf d/phegxtl4JW1p0E63YEb416OcuMbzFU3FVsfcyT98z9Q1tCVmfQHfNlBPK0Onfy o9FvUpJNs8IZBaAkGwhRoCpSe6pbhK0HB7pZDG9ZJR4rdVnGCtwvYfwg71jDYS6r qgXwXroPLbjJufS8FXnnETuEq2kIeMqLEqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1691439350; x=1691525750; bh=c2fZJd/sK/UTjHBs3rbOyYwIFUVe3ySFg+P tp2lSbVk=; b=M5GjnsUe5E0mFGLwPKDfhCy1nIKB3FXQQ8D9dni3R7RHMGu0ocn 3+Ucp+Etx6kZ5E3IPv5Hi+9xJsFpNqW2M1FUdiqoKYwCD4U4L0w+2TOVuziHMvHh 77TBLjmjP0Z80Ny1s5V3legw+TKF+X4jzkL+XON0OBqFaz2FRxG1IDOJjyYOkC+4 BRoeokmGnvUzlqFcXT7hLydpsFEKzboAVFHMWVPNwqlQ1XtF1ymQ/Uy0iyaDGA9f E+s9MNQ4aYlIRmEysSnLD5TrJmCaYknHAjdRseFbAnaAa65m2Kp7+BocTsH+COCL /g3ozJAARjFUc6ZXCV/snYJ3dSkRnI1GYsA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrledtgddugedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufhffjgfkfgggtgfgsehtqhertddtreejnecuhfhrohhmpefvihhm ohhthhihucfurghmphhlvgcuoehsrghmphhlvghtsehnghihrhhordgtohhmqeenucggtf frrghtthgvrhhnpedtkeevgfekveegffehtdfgveetvddukeefffehvdevteegtdevudei gfeftdetvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmphhlvghtsehnghihrhhordgtohhm X-ME-Proxy: Feedback-ID: i4721425c:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Aug 2023 16:15:49 -0400 (EDT) In-Reply-To: (Ekaitz Zarraga's message of "Mon, 07 Aug 2023 18:27:05 +0000") 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-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10649 Archived-At: Hi all, Ekaitz Zarraga writes: > From ab6e4980ea301b5d1e14a98464e5de3e726984f1 Mon Sep 17 00:00:00 2001 > From: Ekaitz Zarraga > Date: Mon, 7 Aug 2023 20:23:42 +0200 > Subject: [PATCH] fix cond1 macro Just adding some context, as we talked about this on IRC. If you take the docs example as is, (define-syntax cond1 (syntax-rules (=3D> else) ((cond1 test =3D> fun) (let ((exp test)) (if exp (fun exp) #f))) ((cond1 test exp exp* ...) (if test (begin exp exp* ...))) ((cond1 else exp exp* ...) (begin exp exp* ...)))) and invoke it as (cond1 else #t) you get Syntax error: unknown location: else: bad use of 'else' syntactic keyword in subform else of else This is because =E2=80=98else=E2=80=99 matches the =E2=80=98(cond1 test exp= exp* ...)=E2=80=99 pattern and gets inserted as the test: (if else (begin #t)) This patch puts the more specific =E2=80=98else=E2=80=99 pattern before the= more general =E2=80=98test=E2=80=99 pattern so it has a chance to be matched. -- Tim