1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00
guile/module
Mihail Iosilevich 158da6966b Allow (library ...) form in cond-expand inside R7RS define-library.
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.

* module/ice-9/r7rs-libraries.scm (define-library): Replace
'resolve-interface' call by 'resolve-r6rs-interface', wrapped in
'cond-expand'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-06-16 09:36:31 +02:00
..
ice-9 Allow (library ...) form in cond-expand inside R7RS define-library. 2022-06-16 09:36:31 +02:00
language psyntax: Pass source vectors to tree-il constructors. 2022-02-07 12:23:35 +01:00
oop goops: Preserve all slot options in redefinable classes. 2021-03-19 21:45:53 +01:00
rnrs Write a proper vector-map and vector-for-each for (rnrs base) 2021-03-09 21:10:04 +01:00
scheme Add function vector-copy! to core 2021-08-06 17:13:21 +02:00
scripts Bump copyright years for user-visible copyright messages 2021-01-07 13:00:46 +01:00
srfi New function srfi-4-vector-type-size in (srfi srfi-4 gnu) 2021-12-06 14:00:03 +01:00
sxml sxml: Make parser thread-safe. 2021-10-22 13:52:40 +02:00
system Bump user-visible copyright years to 2022 2022-02-11 15:21:03 +01:00
texinfo texinfo: Add basic support for @w{...}. 2020-06-18 00:30:30 +02:00
web web: 'tls-wrap' returns an unbuffered custom port. 2021-03-19 14:13:31 +01:00
Makefile.am Rework bootstrap to be reproducible 2022-02-01 14:50:40 +01:00
rnrs.scm Define top-level bindings for aux syntax: else, =>, _, ... 2019-09-12 21:50:51 +02:00
statprof.scm Statprof reports primitive names 2020-06-04 11:46:34 +02:00
texinfo.scm texinfo: Add basic support for @w{...}. 2020-06-18 00:30:30 +02:00