From unknown Fri Sep 12 05:08:59 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#40252 <40252@debbugs.gnu.org> To: bug#40252 <40252@debbugs.gnu.org> Subject: Status: [R7RS] cond-expand in define-library forms Reply-To: bug#40252 <40252@debbugs.gnu.org> Date: Fri, 12 Sep 2025 12:08:59 +0000 retitle 40252 [R7RS] cond-expand in define-library forms reassign 40252 guile submitter 40252 Marc Nieper-Wi=C3=9Fkirchen severity 40252 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 27 11:37:48 2020 Received: (at submit) by debbugs.gnu.org; 27 Mar 2020 15:37:48 +0000 Received: from localhost ([127.0.0.1]:33257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jHr3L-0007Yo-NW for submit@debbugs.gnu.org; Fri, 27 Mar 2020 11:37:48 -0400 Received: from lists.gnu.org ([209.51.188.17]:35855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jHpoC-0005RC-6t for submit@debbugs.gnu.org; Fri, 27 Mar 2020 10:18:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51903) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHpo9-0002Sj-85 for bug-guile@gnu.org; Fri, 27 Mar 2020 10:18:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHpo8-0005Gm-3h for bug-guile@gnu.org; Fri, 27 Mar 2020 10:18:01 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:38356) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHpo7-0005Bb-TX for bug-guile@gnu.org; Fri, 27 Mar 2020 10:18:00 -0400 Received: by mail-pg1-x533.google.com with SMTP id x7so4636183pgh.5 for ; Fri, 27 Mar 2020 07:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=IXbvxp/WH/pVWN6T6mET8bYX5dfBbus11PmNDgfGWDY=; b=quHEUopFo0w/RuKPNaOxtkbrjwG3Jqh4sR185c9SkPuC8UC/WysbyG3PYqlz7r3WP+ YcGkMH9T5U6gv0DPjdBgA8V9WeZ/zi2tXAbYRFX3rghVmYEWzKvdB1zZiRvnYjhYErTJ v8bH3kbuEX9mYuz+ap86m9rRvyu0ih8xYw65Gt4al+CKV/kjV3Wj+6z66XAiagOkSL+l kY5ljazrliFA/o7R8PloYp9CT135E0qV99O+L4gvdWo/iRqCv5Mwzh2PIG4JMo1D64an vrNSDtzBkNojNPG6JOz/Q6fmLbcXtBqf4iChMIytAQxO3Fhb2rD7GjkdVAI/iz7Fg9Sh SHqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=IXbvxp/WH/pVWN6T6mET8bYX5dfBbus11PmNDgfGWDY=; b=AaGcl4g8d6b+MkI8NjApk76MQU70NLuotpylskzDXxWF5MGpmysOZU+7Xvo+cdf2UO q8FoLAuSwa87oZH/+GyJeAUklvo85hlZ7TGh6X6utOrAXQUh+YgIVUrl3utYM+hRA67P qlEs/1uvMwCnxZ/GRdxOCrXE7NMDYiFhtvzTXxpNkfxY/p3qlSDpc/UNx8hTp+ywOyKz x/rej1zZn6aXlywOoDFXCwUJlgrSJGL0Pvd5Wj8F0i9UlX5sDasBRTOE8pwkweQQrQMV lCXoJQt7YFK3nshLtfbBBjnTW9X8HFAgFIspsIT5oF4CkqaRHF8Q9X6U3iF1XkYNJIHu VFjA== X-Gm-Message-State: ANhLgQ2A4PQmZAPM9x6H6eypQm6hOxvNjge0th0i6eAkzzNa/iFQ9v0w 4VDTyrNgaTDAdbwg0h4b1jnBu0jFCUrSgRJL7ENAvUlr0xo= X-Google-Smtp-Source: ADFU+vtIBP5l0nGCHDXeHiq/nvl/JFXTUA3RPTcvz3r3Mdk/6aqpl9NQ2VA3h1ztPOpjR0hikwrZkTuf/525PgnjmQI= X-Received: by 2002:aa7:9a4b:: with SMTP id x11mr14774329pfj.73.1585318677490; Fri, 27 Mar 2020 07:17:57 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?Marc_Nieper=2DWi=C3=9Fkirchen?= Date: Fri, 27 Mar 2020 15:17:45 +0100 Message-ID: Subject: [R7RS] cond-expand in define-library forms To: bug-guile@gnu.org Content-Type: multipart/alternative; boundary="000000000000a0b25005a1d6c4d0" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::533 X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 27 Mar 2020 11:37:44 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --000000000000a0b25005a1d6c4d0 Content-Type: text/plain; charset="UTF-8" The following valid R7RS library definition is not handled correctly by Guile: (define-library (guile-test) (export fold) (cond-expand ((library (scheme list)) (import (scheme list))) ((library (srfi srfi-1)) (import (srfi srfi-1))))) This is what I get: $ guile --r7rs -L . GNU Guile 3.0.1 ... > (import (guile-test)) While compiling expression: no code for module (scheme list) > Thus, the cond-expand library declaration does not seem to be handled correctly. Other experiments with cond-expand also show strange behaviors: (define-library (guile-test) (export foo) (cond-expand (guile (import (scheme base)))) (begin (define foo 42))) > (import (guile-test)) While compiling expression: Syntax error: unknown location: source expression failed to match any pattern in form (((begin (define foo 42)))) -- Marc --000000000000a0b25005a1d6c4d0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The following valid R7RS library definition is not handled correctly by = Guile:
(defin= e-library (guile-test)
=C2=A0 (export fold)
=C2=A0 (cond-expand
= =C2=A0 =C2=A0 ((library (scheme list))
=C2=A0 =C2=A0 =C2=A0(import (sche= me list)))
=C2=A0 =C2=A0 ((library (srfi srfi-1))
=C2=A0 =C2=A0 =C2= =A0(import (srfi srfi-1)))))

This is what I get:

$ guile --r7rs -L .
GNU Guile 3.0.1
...
> (import (guile-test))
While compiling expre= ssion:
no code for module (scheme list)
>

Thus, the cond-expand library declaration does n= ot seem to be handled correctly. Other experiments with cond-expand also sh= ow strange behaviors:

(define-library (guile-test)
=C2=A0 (export foo)
=C2=A0 (cond-expand
= =C2=A0 =C2=A0 (guile
=C2=A0 =C2=A0 =C2=A0(import (scheme base))))
=C2= =A0 (begin
=C2=A0 =C2=A0 (define foo 42)))

> (import (guile-test))
While compiling expressi= on:
Syntax error:
unknown location: source expression failed to match= any pattern in form (((begin (define foo 42))))

--

Marc
--000000000000a0b25005a1d6c4d0-- From debbugs-submit-bounces@debbugs.gnu.org Thu May 07 13:30:45 2020 Received: (at 40252) by debbugs.gnu.org; 7 May 2020 17:30:45 +0000 Received: from localhost ([127.0.0.1]:43866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWkM9-0006JM-99 for submit@debbugs.gnu.org; Thu, 07 May 2020 13:30:45 -0400 Received: from mta-09-3.privateemail.com ([68.65.122.19]:14009) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWkI6-00069c-MZ for 40252@debbugs.gnu.org; Thu, 07 May 2020 13:26:35 -0400 Received: from MTA-09.privateemail.com (localhost [127.0.0.1]) by MTA-09.privateemail.com (Postfix) with ESMTP id 587A860043 for <40252@debbugs.gnu.org>; Thu, 7 May 2020 13:26:28 -0400 (EDT) Received: from [192.168.91.31] (unknown [10.20.151.239]) by MTA-09.privateemail.com (Postfix) with ESMTPA id DA5C960034 for <40252@debbugs.gnu.org>; Thu, 7 May 2020 17:26:27 +0000 (UTC) To: 40252@debbugs.gnu.org From: Adam Nelson Subject: [PATCH] [R7RS] cond-expand in define-library forms Message-ID: <3d50de38-20ab-00d4-9d54-4a742a7bc57e@nels.onl> Date: Thu, 7 May 2020 13:26:25 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40252 X-Mailman-Approved-At: Thu, 07 May 2020 13:30:44 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) It looks like this bug was caused by a missing dot in a list in the cond-expand macro. This small patch fixes it: diff --git a/module/ice-9/r7rs-libraries.scm b/module/ice-9/r7rs-libraries.scm index 6db9de873..221806ad1 100644 --- a/module/ice-9/r7rs-libraries.scm +++ b/module/ice-9/r7rs-libraries.scm @@ -88,11 +88,11 @@          (((include-library-declarations filename ...) . decls)           (syntax-case (handle-includes #'(filename ...)) ()             ((decl ...) -            (partition-decls #'(decl ... decls) exports imports code)))) +            (partition-decls #'(decl ... . decls) exports imports code))))          (((cond-expand clause ...) . decls)           (syntax-case (handle-cond-expand #'(clause ...)) ()             ((decl ...) -            (partition-decls #'(decl ... decls) exports imports code)))))) +            (partition-decls #'(decl ... . decls) exports imports code))))))      (syntax-case stx ()        ((_ name decl ...) From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 03 16:23:59 2020 Received: (at submit) by debbugs.gnu.org; 3 Aug 2020 20:23:59 +0000 Received: from localhost ([127.0.0.1]:46153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2h03-0005eC-G6 for submit@debbugs.gnu.org; Mon, 03 Aug 2020 16:23:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:57158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2h01-0005e1-Bc for submit@debbugs.gnu.org; Mon, 03 Aug 2020 16:23:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2h01-0004fP-67 for bug-guile@gnu.org; Mon, 03 Aug 2020 16:23:57 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:35445) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k2gzz-0001t4-N0 for bug-guile@gnu.org; Mon, 03 Aug 2020 16:23:56 -0400 Received: by mail-pf1-x430.google.com with SMTP id d188so12806236pfd.2 for ; Mon, 03 Aug 2020 13:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=A4mUHEpC6iV95Mafu+folFrgB46ehKB+omR6QKhhSoQ=; b=S/2INjW9bHfh0buH43s2eXI75ZYadwGgbL3Ov9eZRr2saP1GAG3+DBpxxsHmd2l+Gz wiNODFPUg5x6pzGOgwfw4N2LUy4q9xqZkgKznJiyQnxVrJWNXIwU92GF2JNNQaZmqV64 d5IVtlObQOg61w8Na+V1kN3YeB72V7TdSHgBeUsJRkgYUT3EjEmfmkZp3bEIvwBWVOpk 5f8Y3bAOBPo4oofqdheooVZB55Im2ENInDguLOKSyWMHUiL5bQVEyha7UXZIuSG4CZ62 zAMy9aFzuLH7aqzsgXbfC3UPHuhTKRCLibNF/MMYyvb0gjGMPOg+2OygjImsRhcvwuWc wo5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=A4mUHEpC6iV95Mafu+folFrgB46ehKB+omR6QKhhSoQ=; b=V9fbqKFMNoNussNtcg0PmuqgckLqMN7Zxopef9Cnd1iD1GCdZAOlalquqwFaqyJIsm iqED+THulfyfwCyr/OdfveWsnCjWiVohuXVAU4WhmvedpzqNq1fJ7oGpL0zLJwDWLtbp d/rToOSzwRHo0SCDuMsOnWnV0PfK69LHodcJ4Dmju3t144p5JHyTQi4+fiCFlogPs0/0 l9QNjBLoOhKegLqAIfYLgbhDPvDk+Z5LebvsevwElsR1Ftv76JhJ3E58fUhQvLQ6PzMt vpTGkifu0q0fn46jjdANsssT55kYYTKSXigD/sjtPl1fIjQYxzz66gUOdR9Lh/NlbS1l hWQw== X-Gm-Message-State: AOAM533LOocpFv2o8F6QeOKOiI0PS6yFtHw4CkZusznycVySPSnWTWt1 htBsFKj+PXS3zA+xWn9R4Row51iqgu09S2FI72w= X-Google-Smtp-Source: ABdhPJxKltO8+PaqP3gBCP96RcFH7JoY+GJIsM3DsUBOU+PLZ4yPcjp9eE16pruj4FAn7LBEn/ztwX6b33SuS9YSyMc= X-Received: by 2002:a63:af01:: with SMTP id w1mr16664256pge.23.1596486233764; Mon, 03 Aug 2020 13:23:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Marc_Nieper=2DWi=C3=9Fkirchen?= Date: Mon, 3 Aug 2020 22:23:42 +0200 Message-ID: Subject: Re: [R7RS] cond-expand in define-library forms To: =?UTF-8?Q?Marc_Nieper=2DWi=C3=9Fkirchen?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=marc.nieper@gmail.com; helo=mail-pf1-x430.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: bug-guile@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) *bump* Am Fr., 27. M=C3=A4rz 2020 um 15:17 Uhr schrieb Marc Nieper-Wi=C3=9Fkirchen : > > The following valid R7RS library definition is not handled correctly by G= uile: > > (define-library (guile-test) > (export fold) > (cond-expand > ((library (scheme list)) > (import (scheme list))) > ((library (srfi srfi-1)) > (import (srfi srfi-1))))) > > This is what I get: > > $ guile --r7rs -L . > GNU Guile 3.0.1 > ... > > (import (guile-test)) > While compiling expression: > no code for module (scheme list) > > > > Thus, the cond-expand library declaration does not seem to be handled cor= rectly. Other experiments with cond-expand also show strange behaviors: > > (define-library (guile-test) > (export foo) > (cond-expand > (guile > (import (scheme base)))) > (begin > (define foo 42))) > > > (import (guile-test)) > While compiling expression: > Syntax error: > unknown location: source expression failed to match any pattern in form (= ((begin (define foo 42)))) > > -- > > Marc From debbugs-submit-bounces@debbugs.gnu.org Sat May 01 16:25:59 2021 Received: (at 40252-done) by debbugs.gnu.org; 1 May 2021 20:25:59 +0000 Received: from localhost ([127.0.0.1]:38221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcwBb-0005Eg-NV for submit@debbugs.gnu.org; Sat, 01 May 2021 16:25:59 -0400 Received: from fanzine.igalia.com ([178.60.130.6]:50850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcwBY-0005EZ-Og for 40252-done@debbugs.gnu.org; Sat, 01 May 2021 16:25:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=+bt4hMbvVSAa+vSJjVgBsX75zQAH7YGqZoZ9ekW/ydI=; b=qy4v053uGDhPUkSpyeq/TdCmqZ2urpEu9iMdfwM8jUkVml3rdbOq9Snk3T3OQLlZel/wb8XLOYBTYaD6CMrOTLz5+cUdN3zaE3+ZD9M4SpNNmJWNIvMNJHMl2NfXg2VUCTIAJF1a1+C1L25q6uRI/PUblRe3SHPKbVe5Dm5wuT/k9JpGAaFVFwanSzdfdZeG75LdITLwkwpFlcckFj2h3MbJ50GnaJzklIw9fb4YPWtUlTAq40YyuotmjjfQKbetWuK7mTYW2xMx8mQ8zHDdFRZrbshuOxnytWb07fzoCUTWDRWfDu8Z5UkfcTWu+LaqZTLaTh24J1qEeNlhrcg59g==; Received: from 82-65-63-215.subs.proxad.net ([82.65.63.215] helo=sparrow) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1lcwBS-0000Zi-0w for <40252-done@debbugs.gnu.org>; Sat, 01 May 2021 22:25:50 +0200 From: Andy Wingo To: 40252-done@debbugs.gnu.org Subject: Applied Date: Sat, 01 May 2021 22:25:39 +0200 Message-ID: <87y2cyjj5o.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 40252-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Thanks for the report and fix, and apologies for the delay! Andy From unknown Fri Sep 12 05:08:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 30 May 2021 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator