From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Cournoyer <maxim.cournoyer@gmail.com> Newsgroups: gmane.lisp.guile.bugs Subject: bug#65363: Missing support for (library ...) match condition in 'cond-expand' Date: Mon, 27 Nov 2023 22:53:06 -0500 Message-ID: <87edga5yal.fsf@gmail.com> References: <86pm3ky4lk.fsf@163.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31739"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 65363@debbugs.gnu.org To: Zhu Zihao <all_but_last@163.com> Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Tue Nov 28 04:54:23 2023 Return-path: <bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org> 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 <bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org>) id 1r7pB1-00088I-OE for guile-bugs@m.gmane-mx.org; Tue, 28 Nov 2023 04:54:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <bug-guile-bounces@gnu.org>) id 1r7pAb-0007m4-Ch; Mon, 27 Nov 2023 22:53:57 -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 <Debian-debbugs@debbugs.gnu.org>) id 1r7pAZ-0007lf-Rk for bug-guile@gnu.org; Mon, 27 Nov 2023 22:53:55 -0500 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 <Debian-debbugs@debbugs.gnu.org>) id 1r7pAZ-0005DO-JY for bug-guile@gnu.org; Mon, 27 Nov 2023 22:53:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1r7pAf-0002ep-Vn for bug-guile@gnu.org; Mon, 27 Nov 2023 22:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Maxim Cournoyer <maxim.cournoyer@gmail.com> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 28 Nov 2023 03:54:01 +0000 Resent-Message-ID: <handler.65363.B65363.170114360210152@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65363 X-GNU-PR-Package: guile Original-Received: via spool by 65363-submit@debbugs.gnu.org id=B65363.170114360210152 (code B ref 65363); Tue, 28 Nov 2023 03:54:01 +0000 Original-Received: (at 65363) by debbugs.gnu.org; 28 Nov 2023 03:53:22 +0000 Original-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@debbugs.gnu.org>) id 1r7pA2-0002df-2s for submit@debbugs.gnu.org; Mon, 27 Nov 2023 22:53:22 -0500 Original-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@gmail.com>) id 1r7pA0-0002dS-Cl for 65363@debbugs.gnu.org; Mon, 27 Nov 2023 22:53:20 -0500 Original-Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-778ac9c898dso231680885a.0 for <65363@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) Original-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) In-Reply-To: <86pm3ky4lk.fsf@163.com> (Zhu Zihao's message of "Fri, 18 Aug 2023 19:18:16 +0800") 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" <bug-guile.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-guile>, <mailto:bug-guile-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/bug-guile> List-Post: <mailto:bug-guile@gnu.org> List-Help: <mailto:bug-guile-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-guile>, <mailto:bug-guile-request@gnu.org?subject=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:10724 Archived-At: <http://permalink.gmane.org/gmane.lisp.guile.bugs/10724> Hi, Zhu Zihao <all_but_last@163.com> 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