GNU bug report logs - #65363
Missing support for (library ...) match condition in 'cond-expand'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: Zhu Zihao <all_but_last@HIDDEN>; Keywords: moreinfo; dated Fri, 18 Aug 2023 11:27:02 UTC; Maintainer for guile is bug-guile@HIDDEN.
Added tag(s) moreinfo. Request was from Maxim Cournoyer <maxim.cournoyer@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 65363 <at> debbugs.gnu.org:


Received: (at 65363) by debbugs.gnu.org; 28 Nov 2023 03:53:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 27 22:53:22 2023
Received: from localhost ([127.0.0.1]:45194 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r7pA2-0002df-2s
	for submit <at> debbugs.gnu.org; Mon, 27 Nov 2023 22:53:22 -0500
Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]:58436)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1r7pA0-0002dS-Cl
 for 65363 <at> debbugs.gnu.org; Mon, 27 Nov 2023 22:53:20 -0500
Received: by mail-qk1-x733.google.com with SMTP id
 af79cd13be357-778ac9c898dso231680885a.0
 for <65363 <at> debbugs.gnu.org>; Mon, 27 Nov 2023 19:53:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1701143587; x=1701748387; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=r2gRoMV+GgqTqLWsam7NnL8aFDdQSe3qxoqXcjG8H8c=;
 b=PbZMyRrQKmf+nAjbX2aRI+a6uB2wTNKE3/Uo45/+AFppKGoCr9eZCL7KBHziFWOCY/
 t562JGmOw0K9o6cpQDrtAb43TP1hw4ps2WjZr+ceEjTQqo+UoB3SKsZKKq9fNmutS3nN
 xIX9PEQFWFBcnluQeYuwYHh8SwngaZstbRlWDnZcqKnenT0OhRpabOsXtv5P8wXvoxEz
 dkZRmXlb0EZ16a134sQFkrsW84E582fSGyHrOwijQgauUFoeCX//uMonzCX+c4GOyFmt
 GsdEsxb5Y1quy5ha6JLhmqARH32KymevO+fDBFz3PB73WtOr3iFP3dfEQ/bP6Gy8jFib
 pDpw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1701143587; x=1701748387;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=r2gRoMV+GgqTqLWsam7NnL8aFDdQSe3qxoqXcjG8H8c=;
 b=cV9mcmfw+FSkWJHVkirn4AVIuYbO12M47z5RLBx1tQw95qTPgTS8m5EhL4U7w/jbti
 kAgmtydHmyBUMl4Qlhg/dfXy5BMGzxPn2IwRfCosHm9LzFd0KYdeNyCmch9wW3rpxBFL
 DGyDusEEDCrSKnk9EvDjN+wnNfG1AFJBpK/j3XCY9ARlSoPRreaZawwY/T5GpBqt/fOr
 i7VAbdBW3J8a3mWa6Oi0W3foS5LKs8IBwIIHC3W1toceClTBvnWEBxvlabwH/5jwAbjA
 LuWIbdEts2F+L7yje9jg68YgERsbfT3aqua8RNikSQNfvtTg3wqLYB8233PdOo+S9AiH
 o+NA==
X-Gm-Message-State: AOJu0YzTYbTZKpt6E8upLnJoPGVjOl2+BiM1E0EP0mUcaaD/cMbskjAn
 ealVBITmMqwJMVUBTvY20aXbHVlu44Q=
X-Google-Smtp-Source: AGHT+IG5SLVMKqTWPTkMZJPaSmqkzz+vIjcvpCwEMtFVgA9jiHdiJRb3suFx4V7bubze28ha4GnF1Q==
X-Received: by 2002:a05:6214:883:b0:67a:3ef2:3a77 with SMTP id
 cz3-20020a056214088300b0067a3ef23a77mr6720918qvb.60.1701143587547; 
 Mon, 27 Nov 2023 19:53:07 -0800 (PST)
Received: from hurd (dsl-154-146.b2b2c.ca. [66.158.154.146])
 by smtp.gmail.com with ESMTPSA id
 u2-20020a0cf882000000b0067a3abec392sm1963435qvn.66.2023.11.27.19.53.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 27 Nov 2023 19:53:07 -0800 (PST)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: Zhu Zihao <all_but_last@HIDDEN>
Subject: Re: bug#65363: Missing support for (library ...) match condition in
 'cond-expand' 
In-Reply-To: <86pm3ky4lk.fsf@HIDDEN> (Zhu Zihao's message of "Fri, 18 Aug
 2023 19:18:16 +0800")
References: <86pm3ky4lk.fsf@HIDDEN>
Date: Mon, 27 Nov 2023 22:53:06 -0500
Message-ID: <87edga5yal.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 65363
Cc: 65363 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

Zhu Zihao <all_but_last@HIDDEN> writes:

> In R7RS, page 14, section 4.2.1 Conditionals. The form 'cond-expand' can
> accept following conditions
>
> ```
> A <feature requirement> takes one of the following forms:
>
> - <feature identifier>
> - (library <library name>)
> - (and <feature requirement> ...)
> - (or <feature requirement> ...)
> - (not <feature requirement>)
> ```
>
> The form (library <library name>) is used to test whether a R7RS library
> named <library name> exists or not. For example:
>
> ```
> (cond-expand
>  ((library (srfi srfi-1))
>   (display "Yes, we have SRFI-1.\n")))
> ```
>
> However, this form is currently not supported by Guile. Supporting this
> form can help Guile use portable R7RS library more smoothly.

I'm not sure what doesn't work with the above example; it should work
when used within a define-library, per this 2020 commit:

--8<---------------cut here---------------start------------->8---
commit fd2ffc649c2d08639c2ac41c25e4ebdbeb4b151d
Date:   Sun Jan 12 20:14:30 2020 +0100

    Support R7RS define-library
--8<---------------cut here---------------end--------------->8---

I've found it had a few omissions, which I've corrected locally, such as
not handling 'else' clauses or (srfi N) names, but your example should
have worked, AFAIK.

If trying 'cond-expand' from the REPL, you'll want to ,use (scheme base)
to get the newer cond-expand definition shadow the SRFI 0 one that is
defined in (guile).

-- 
Thanks,
Maxim




Information forwarded to bug-guile@HIDDEN:
bug#65363; Package guile. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Aug 2023 11:26:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 18 07:26:25 2023
Received: from localhost ([127.0.0.1]:46188 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qWxcX-0000Ih-9o
	for submit <at> debbugs.gnu.org; Fri, 18 Aug 2023 07:26:25 -0400
Received: from lists.gnu.org ([2001:470:142::17]:54382)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <all_but_last@HIDDEN>) id 1qWxcU-0000IT-Gn
 for submit <at> debbugs.gnu.org; Fri, 18 Aug 2023 07:26:24 -0400
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 <all_but_last@HIDDEN>)
 id 1qWxcO-0005L8-Cm
 for bug-guile@HIDDEN; Fri, 18 Aug 2023 07:26:16 -0400
Received: from m12.mail.163.com ([220.181.12.215])
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <all_but_last@HIDDEN>) id 1qWxcK-0003uR-6A
 for bug-guile@HIDDEN; Fri, 18 Aug 2023 07:26:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;
 s=s110527; h=From:Subject:Date:Message-ID:MIME-Version:
 Content-Type; bh=jxqgwZmSazAq0KvB0P89QlpeZJDmaQTDbJ49ZZelTg4=;
 b=LuhIyeqdH2LTRruYevdfJu++QXS1WarXpti7gNXfR1ER4ryoo34w54EO5O47kV
 bs1rIF0fr/1QU6Prsho1dbkc+Ay63d9pKlCuUQ3cV7Gz6FvbSptG5xmot9Hi1xn3
 W7Vhcd1Onkn652DyaR3H/vEXN0HPzvsmKdL47gU+7HudQ=
Received: from asus-laptop (unknown [119.123.67.67])
 by zwqz-smtp-mta-g0-1 (Coremail) with SMTP id _____wCXv89IVd9kxzW1DQ--.40031S2;
 Fri, 18 Aug 2023 19:26:01 +0800 (CST)
User-agent: mu4e 1.10.5; emacs 30.0.50
From: Zhu Zihao <all_but_last@HIDDEN>
To: bug-guile@HIDDEN
Subject: Missing support for (library ...) match condition in 'cond-expand' 
Date: Fri, 18 Aug 2023 19:18:16 +0800
Message-ID: <86pm3ky4lk.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-CM-TRANSID: _____wCXv89IVd9kxzW1DQ--.40031S2
X-Coremail-Antispam: 1Uf129KBjvdXoW7XFW8urWDAw1xCFy7Xr13Jwb_yoW3WFX_Gr
 WkJwsrJF18ZrW2vry5K3yI9ayxX39F9Fy5JrW0gr1Yv34rJa1fGrZFyrsYgwnFyayrX34q
 93Z5K343tw1akjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT
 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUVTYUUUUUU==
X-Originating-IP: [119.123.67.67]
X-CM-SenderInfo: pdoosuxxwbztlvw6il2tof0z/xtbBoQrPr2I0Z05m3AAAsO
Received-SPF: pass client-ip=220.181.12.215; envelope-from=all_but_last@HIDDEN;
 helo=m12.mail.163.com
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, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L4=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

--=-=-=
Content-Type: text/plain

In R7RS, page 14, section 4.2.1 Conditionals. The form 'cond-expand' can
accept following conditions

```
A <feature requirement> takes one of the following forms:

- <feature identifier>
- (library <library name>)
- (and <feature requirement> ...)
- (or <feature requirement> ...)
- (not <feature requirement>)
```

The form (library <library name>) is used to test whether a R7RS library
named <library name> exists or not. For example:

```
(cond-expand
 ((library (srfi srfi-1))
  (display "Yes, we have SRFI-1.\n")))
```

However, this form is currently not supported by Guile. Supporting this
form can help Guile use portable R7RS library more smoothly.

-- Retrieve my PGP public key:

  gpg --recv-keys B3EBC086AB0EBC0F45E0B4D433DB374BCEE4D9DC

Zihao

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQT4UAIrVkIEZilSHr2K2nJqP6LM8gUCZN9VOBUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQitpyaj+izPLw+QD/d7pTeyqg22FSu6LGkOikxVIlMkpm
T0fxkGmNKy0igjkBAJ2siplfRiGUlN+Y0A259rcgXhLiQEKpSOYPuwRkDmcL
=O5vk
-----END PGP SIGNATURE-----
--=-=-=--





Acknowledgement sent to Zhu Zihao <all_but_last@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#65363; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 28 Nov 2023 04:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.