From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Marc =?UTF-8?Q?Nieper-Wi=C3=9Fkirchen?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#40371: [R7RS] Guile does not accept library name parts that are non-negative exact integers Date: Thu, 2 Apr 2020 21:47:19 +0200 Message-ID: References: <87369lg132.fsf@igalia.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003f029b05a2541286" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="99514"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40371@debbugs.gnu.org To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Thu Apr 02 21:52:13 2020 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 1jK5sq-000Pkj-CK for guile-bugs@m.gmane-mx.org; Thu, 02 Apr 2020 21:52:12 +0200 Original-Received: from localhost ([::1]:46742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK5sp-0008GB-Fj for guile-bugs@m.gmane-mx.org; Thu, 02 Apr 2020 15:52:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39510) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK5sj-0008Fr-As for bug-guile@gnu.org; Thu, 02 Apr 2020 15:52:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jK5sh-0001OC-OZ for bug-guile@gnu.org; Thu, 02 Apr 2020 15:52:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57511) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jK5sg-0001NP-1g for bug-guile@gnu.org; Thu, 02 Apr 2020 15:52:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jK5sf-0001XT-V0 for bug-guile@gnu.org; Thu, 02 Apr 2020 15:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Marc =?UTF-8?Q?Nieper-Wi=C3=9Fkirchen?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 02 Apr 2020 19:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40371 X-GNU-PR-Package: guile Original-Received: via spool by 40371-submit@debbugs.gnu.org id=B40371.15858571105871 (code B ref 40371); Thu, 02 Apr 2020 19:52:01 +0000 Original-Received: (at 40371) by debbugs.gnu.org; 2 Apr 2020 19:51:50 +0000 Original-Received: from localhost ([127.0.0.1]:40824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jK5sT-0001Wb-EP for submit@debbugs.gnu.org; Thu, 02 Apr 2020 15:51:49 -0400 Original-Received: from mail-pg1-f171.google.com ([209.85.215.171]:32859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jK5oO-0001J1-N6 for 40371@debbugs.gnu.org; Thu, 02 Apr 2020 15:47:37 -0400 Original-Received: by mail-pg1-f171.google.com with SMTP id d17so2340407pgo.0 for <40371@debbugs.gnu.org>; Thu, 02 Apr 2020 12:47:36 -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; bh=PBgghkD59j/V454qHcVekRtJefBzc7cy84Con9m2IL4=; b=npH9o4HzC3LA6QuNLi+zGABSmFn7Fy/y6penTfpqYmQzOy1uZv+B+DT/oEwI1zFQPJ /xnkRI1wL94aLefJOKbIlOaAikoNQxo0Fp8FZwEGImwtG9wW5ZlGk4iVfzBbE0bTqaHN OOd7wtpDIWAmC/1jg3dFk/fUr2Tk71p4T7UzOJvT+y7/63AyyTj4zwG61rVIdRPrVgHW 0Rb1oIVKBH+RlwbCVX3O+6MEsmwYPgoibyNPyw4ZmU4+JuKSh3h2XRcCPP88Eks09epH XA9ZfuCd+YkgBrXX95W/cSJUb5Va0qMGwRBsJ8oQD/5qrd4CTZi/dUfm1A3/uz0+PTNV jkBg== 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; bh=PBgghkD59j/V454qHcVekRtJefBzc7cy84Con9m2IL4=; b=Z+ak+O7EmHabJWCBMGDudXVKqfdobJJ19uDf0LpcSOyDNA4kXAZKDtdSxKRV/Nuykv BaJs+TlJmGf34suuIXi3VWKDuU2/wUNynZltJqZgs2ZUalVLKEiMPh7vTrKIG+KK5wJ5 ZaxdMjHFTeBeKw1ak9owOzf6rb9ZgziIfRRMwLegzhYnLyZJeNV7EIz6WMUkRqJN6BoH OP5TEimYA+qSNiCPdOcmNLFiXPcb5M9tWtJrFuyqFL79y+yv1fJWbHDuveMMtIUfci5P b0ADix8iZxat5gmuOXaemOGk+diTZaVA52CxlWWw36rNkfTvtNKCBTVVv9BD26g4hBcV pJvQ== X-Gm-Message-State: AGi0PuYuoA16t5jbjYAsfVZKtrt/p/+TmE6D4Sdqed6HiaATCroPQPP8 +b63LZxfuCFIfnJ/vde01ompf135SPgA1OyOoNzX2W5nhYU= X-Google-Smtp-Source: APiQypKvJRz9j/gM9UjYOYqRa3AKRI4y1RAfD8jyAkzXbYVc2+RC408YXgHJANeRq1R5yvDzow69VbL7ybtv/h5QM6A= X-Received: by 2002:a63:a601:: with SMTP id t1mr4862889pge.23.1585856850623; Thu, 02 Apr 2020 12:47:30 -0700 (PDT) In-Reply-To: <87369lg132.fsf@igalia.com> X-Mailman-Approved-At: Thu, 02 Apr 2020 15:51:48 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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:9708 Archived-At: --0000000000003f029b05a2541286 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Am Do., 2. Apr. 2020 um 21:05 Uhr schrieb Andy Wingo : > In the concrete case of the SRFI modules, importing e.g. (srfi 9) works > AFAIU. Does this not work for you? > I use Guile 3.9.1. I can do (import (srfi srfi-9)), but I can't do (import (srfi 9)). That latter yields the error: source expression failed to match any pattern in form (srfi 9). > > I think that allowing numbers as module name components, beyond the SRFI > modules, is not currently a good idea for Guile. I had a look at it and > it's a bit too intrusive. If numbers are not allowed, Guile will be severely crippled with respect to R7RS code. Most SRFIs are distributed under the name `(srfi NNN)' so many R7RS programs intended to be portable will try to import libraries of the form, say `(srfi 9)' and Guile would complain. `cond-expand' is not helpful here in general as an R7RS top-level program has to start with an import and cannot start with some `(cond-expand (guile ...))'. (Besides, `cond-expand' has its own problems: https://lists.gnu.org/archive/html/bug-guile/2020-03/msg00097.html). As a quick-and-dirty workaround, I would suggest that the Guiles (syntax-case?) parser of library names accepts numbers as module name components but treats them internally as symbols (say, by prefixing them with a colon) so that the main module code doesn't have to be touched. The locator for library code in the file system will then have to look for a filenname with a colon and without. Marc > > Andy > > On Wed 01 Apr 2020 12:47, Marc Nieper-Wi=C3=9Fkirchen > writes: > > > An R7RS library name consists of parts, where each part is either a > symbol or > > a non-negative exact integer. Guile doesn't support the latter ones. > > > > This is unfortunate as the implementation of a SRFI NNN is usually > delivered > > in form of a library named (srfi NNN). > > > > When this is corrected, for interoperability, it would be great if Guil= e > offers > > the included SRFIs not only under the name (srfi srfi-NNN) but also und= er > > (srfi NNN). > > > > Thanks, > > > > Marc > --0000000000003f029b05a2541286 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Am Do., 2. Apr. 2020 um 21:05=C2=A0Uhr schrie= b Andy Wingo <wingo@igalia.com&g= t;:
In the concr= ete case of the SRFI modules, importing e.g. (srfi 9) works
AFAIU.=C2=A0 Does this not work for you?

I use Guile = 3.9.1.
I can = do (import (srfi srfi-9)), but I can't do (import (srfi 9)).

That latter yields the = error:
source= expression failed to match any pattern in form (srfi 9).
=C2=A0

I think that allowing numbers as module name components, beyond the SRFI modules, is not currently a good idea for Guile.=C2=A0 I had a look at it a= nd
it's a bit too intrusive.

If numbers are not allowed,= Guile will be severely crippled with respect to R7RS code. Most SRFIs are = distributed under the name `(srfi NNN)' so many R7RS programs intended = to be portable will try to import libraries of the form, say `(srfi 9)'= and Guile would complain.

`cond-expand' is not helpful here in general as an R7RS = top-level program has to start with an import and cannot start with some `(= cond-expand (guile ...))'. (Besides, `cond-expand' has its own prob= lems: https://lists.gnu.org/archive/html/bug-guile/2020-03/msg00097.htm= l).

As a quick-and-dirty workaround, I would suggest that the Gui= les (syntax-case?) parser of library names accepts numbers as module name c= omponents but treats them internally as symbols (say, by prefixing them wit= h a colon) so that the main module code doesn't have to be touched. The= locator for library code in the file system will then have to look for a f= ilenname with a colon and without.

Marc

=C2= =A0

Andy

On Wed 01 Apr 2020 12:47, Marc Nieper-Wi=C3=9Fkirchen <marc.nieper@gmail.com> wri= tes:

> An R7RS library name consists of parts, where each part is either a sy= mbol or
> a non-negative exact integer. Guile doesn't support the latter one= s.
>
> This is unfortunate as the implementation of a SRFI NNN is usually del= ivered
> in form of a library named (srfi NNN).
>
> When this is corrected, for interoperability, it would be great if Gui= le offers
> the included SRFIs not only under the name (srfi srfi-NNN) but also un= der
> (srfi NNN).
>
> Thanks,
>
> Marc
--0000000000003f029b05a2541286--