From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#39162: [PATCH] Fix file lookup of modules with a dot in their name. Date: Sat, 21 Mar 2020 22:46:20 +0100 Message-ID: <878sjtxtxv.fsf@gnu.org> References: <875zhartv8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="53523"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: 39162@debbugs.gnu.org To: Jan Nieuwenhuizen Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sat Mar 21 22:47:10 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 1jFlxW-000Dqn-18 for guile-bugs@m.gmane-mx.org; Sat, 21 Mar 2020 22:47:10 +0100 Original-Received: from localhost ([::1]:41122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFlxV-0007Dq-3W for guile-bugs@m.gmane-mx.org; Sat, 21 Mar 2020 17:47:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55677) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFlxP-0007Dk-Bk for bug-guile@gnu.org; Sat, 21 Mar 2020 17:47:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFlxO-0000Wg-Dh for bug-guile@gnu.org; Sat, 21 Mar 2020 17:47:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42339) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jFlxO-0000WQ-Ap for bug-guile@gnu.org; Sat, 21 Mar 2020 17:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jFlxO-0007dK-AF for bug-guile@gnu.org; Sat, 21 Mar 2020 17:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 21 Mar 2020 21:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39162 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Original-Received: via spool by 39162-submit@debbugs.gnu.org id=B39162.158482719429306 (code B ref 39162); Sat, 21 Mar 2020 21:47:02 +0000 Original-Received: (at 39162) by debbugs.gnu.org; 21 Mar 2020 21:46:34 +0000 Original-Received: from localhost ([127.0.0.1]:48312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFlww-0007cb-Iz for submit@debbugs.gnu.org; Sat, 21 Mar 2020 17:46:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40501) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFlwv-0007cM-Ek for 39162@debbugs.gnu.org; Sat, 21 Mar 2020 17:46:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jFlwq-0008BI-8T; Sat, 21 Mar 2020 17:46:28 -0400 Original-Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=56246 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jFlwn-0002sa-31; Sat, 21 Mar 2020 17:46:28 -0400 In-Reply-To: <875zhartv8.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Fri, 17 Jan 2020 16:21:47 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:9678 Archived-At: Hi! Jan Nieuwenhuizen skribis: > Much to my surprise, Guile (v2.2 and 3.0 alike) fail to load a module > that has a dot in its base name. Directory names with dots > (e.g. ice.10/boot-10.scm =3D> (ice.10 boot-10)) are fine. [...] > - /* If FILENAME has an extension, don't try to add EXTENSIONS to it. */ > - { > - char *endp; > - > - for (endp =3D filename_chars + filename_len - 1; > - endp >=3D filename_chars; > - endp--) > - { > - if (*endp =3D=3D '.') > - { > - if (!string_has_an_ext (filename, extensions)) > - { > - /* This filename has an extension, but not one of the ri= ght > - ones... */ > - goto end; > - } > - /* This filename already has an extension, so cancel the > - list of extensions. */ > - extensions =3D SCM_EOL; > - break; > - } > - else if (is_file_name_separator (SCM_MAKE_CHAR (*endp))) > - /* This filename has no extension, so keep the current list > - of extensions. */ > - break; > - } > - } This code mostly dates back to 1999 (commit 563841768b8659dad87296be4ae9ce589cbe99d4). It has to do with the fact that you can omit the extension when loading a file, in which case one of those in =E2=80=98%load-extensions=E2=80=99 is picked up: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (primitive-load-path "ice-9/q") scheme@(ice-9 q)> --8<---------------cut here---------------end--------------->8--- The usefulness of this mechanism is debatable :-), but I don=E2=80=99t thin= k we can change it during a stable release. I wonder if there are other ways we could support file names with dots. However, note that symbols containing dots are non-standard (R5RS does not allow it.) Thoughts? Ludo=E2=80=99.