bug-guile
[Top][All Lists]
Advanced

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

bug#52218: Unable to define more than one R7RS library per file


From: Linus Björnstam
Subject: bug#52218: Unable to define more than one R7RS library per file
Date: Fri, 03 Dec 2021 15:20:35 +0100
User-agent: Cyrus-JMAP/3.5.0-alpha0-4458-g51a91c06b2-fm-20211130.004-g51a91c06

It is the same bug. The r7rs define-library expands to a r6rs library, which 
expands to a guile module form that lacks support for multiple libraries. The 
solution would probably include a non-trivial (but probably not very big) 
change to guile's module system.

First you would have to save and restore the current module before and after a 
module definition (maybe in save-module-excursion?). Then I would separate the 
library form the guile library form (since that doesn't encapsulate the body), 
by expanding it directly to the lower level module forms.

I might give it a shot.

-- 
  Linus Björnstam

On Thu, 2 Dec 2021, at 03:55, Sam Lee wrote:
> On 2021-12-01 11:00 +0100, Linus Björnstam wrote:
>> This is in line with the limitations of guile's R6RS implementation. I
>> think this is a long standing, low priority bug. It has to do with the
>> expansion of library (or define-library in this case) not properly
>> resetting the current module.
>>
>> In the manual there is a section called "R6RS incompatibilities" that
>> mentions this. Maybe an "R7RS incompatibilities" should be added.
>
> Hi Linus,
>
> There already exist a page in the manual about "Incompatibilities with
> the R7RS" [1]. Perhaps a paragraph similar to that found in the R6RS
> incompatibilities page should be added to the R7RS incompatibilities
> page. Something like this:
>
> "Multiple @code{define-library} forms in one file are not yet supported.
> This is because the expansion of @code{define-library} sets the current
> module, but does not restore it.  This is a bug."
>
> [1]: 
> https://www.gnu.org/software/guile/manual/html_node/R7RS-Incompatibilities.html





reply via email to

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