emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#55934: closed ([PATCH] (library ...) form in cond-expand inside R7RS


From: GNU bug Tracking System
Subject: bug#55934: closed ([PATCH] (library ...) form in cond-expand inside R7RS define-library)
Date: Thu, 16 Jun 2022 07:38:02 +0000

Your message dated Thu, 16 Jun 2022 09:37:37 +0200
with message-id <87czf9oy7y.fsf@gnu.org>
and subject line Re: bug#55934: [PATCH] (library ...) form in cond-expand 
inside R7RS define-library
has caused the debbugs.gnu.org bug report #55934,
regarding [PATCH] (library ...) form in cond-expand inside R7RS define-library
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
55934: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55934
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] (library ...) form in cond-expand inside R7RS define-library Date: Sun, 12 Jun 2022 13:13:32 +0300
Guile (3.0.8) reports a compilation error when cond-expand tries to
check existence of a missing library:

    scheme@(guile-user)> (define-library (test)
                           (cond-expand
                            ((library (scheme sort))
                             (import (scheme sort)))))
    While compiling expression:
    no code for module (scheme sort)

It looks like bug #40252 was not fully eliminated.

Also, (library ...) cannot handle module names like (srfi 1), though
(import (srfi 1)) works fine. For example, this code fails:

    scheme@(guile-user)> (define-library (test)
                           (cond-expand
                            ((library (srfi 1))
                             (import (srfi 1)))))
    While compiling expression:
    In procedure symbol->string: Wrong type argument in position 1
    (expecting symbol): 1

There are probably other cases when (library ...) and (import ...) does
not work identically: (library ...) uses resolve-interface while
(import ...) uses resolve-r6rs-interface.

This patch fixes both issues.

diff --git a/module/ice-9/r7rs-libraries.scm b/module/ice-9/r7rs-libraries.scm
index c4c4da22f..63a300a26 100644
--- a/module/ice-9/r7rs-libraries.scm
+++ b/module/ice-9/r7rs-libraries.scm
@@ -55,7 +55,10 @@
           ((not req)
            (not (has-req? #'req)))
           ((library lib-name)
-           (->bool (resolve-interface (syntax->datum #'lib-name))))
+           (->bool
+            (false-if-exception
+             (resolve-r6rs-interface
+              (syntax->datum #'lib-name)))))
           (id
            (identifier? #'id)
            ;; FIXME: R7RS (features) isn't quite the same as

-- 
Mihail Iosilevitch



--- End Message ---
--- Begin Message --- Subject: Re: bug#55934: [PATCH] (library ...) form in cond-expand inside R7RS define-library Date: Thu, 16 Jun 2022 09:37:37 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
Hi,

Mihail Iosilevich <yosik@paranoid.email> skribis:

> Guile (3.0.8) reports a compilation error when cond-expand tries to
> check existence of a missing library:
>
>     scheme@(guile-user)> (define-library (test)
>                            (cond-expand
>                             ((library (scheme sort))
>                              (import (scheme sort)))))
>     While compiling expression:
>     no code for module (scheme sort)
>
> It looks like bug #40252 was not fully eliminated.
>
> Also, (library ...) cannot handle module names like (srfi 1), though
> (import (srfi 1)) works fine. For example, this code fails:
>
>     scheme@(guile-user)> (define-library (test)
>                            (cond-expand
>                             ((library (srfi 1))
>                              (import (srfi 1)))))
>     While compiling expression:
>     In procedure symbol->string: Wrong type argument in position 1
>     (expecting symbol): 1
>
> There are probably other cases when (library ...) and (import ...) does
> not work identically: (library ...) uses resolve-interface while
> (import ...) uses resolve-r6rs-interface.
>
> This patch fixes both issues.

That looks reasonable to me.

I added a ChangeLog-style entry and committed it, thanks!

Ludo’.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]