Opened 16 years ago
Closed 16 years ago
#58 closed defect (fixed)
Local definition of fold overwrites srfi-1 definition
| Reported by: | Ivan Raikov | Owned by: | felix winkelmann |
|---|---|---|---|
| Priority: | critical | Milestone: | |
| Component: | extensions | Version: | |
| Keywords: | ssax | Cc: | sjamaan |
| Estimated difficulty: |
Description
The ssax library uses its own internal definition of fold, which is not exported by the module. However, programs that load both srfi-1 and ssax, end up using the ssax definition. The attached test file fails to call fold from srfi-1 when ssax is loaded, but succeeds and ssax is not loaded.
Attachments (2)
Change History (9)
Changed 16 years ago by
comment:1 Changed 16 years ago by
| Milestone: | → 4.1.0 |
|---|
comment:2 Changed 16 years ago by
| Component: | core libraries → extensions |
|---|---|
| Keywords: | ssax added |
| Milestone: | 4.1.0 |
| Version: | 4.0.x |
The problem is here that SSAX imports srfi-1. Re-definition of imported bindings causes the original binding to be changed (global define is mostly equivalent to set!). The compiler will issue a warning about this (and does so for SSAX).
This is arguably a bug in SSAX (or in the port). An option would be to disallow re-definition of imported bindings in general.
comment:3 Changed 16 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
As ssax already imports srfi-1, I have removed its own definition of fold.
comment:4 Changed 16 years ago by
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
Please don't hack the code to ssax itself, this makes SSAX harder to maintain! Changes would be discarded when a newer version is imported.
Didn't you see the README file?
Please use the following patch instead.
comment:5 Changed 16 years ago by
Thanks for the tip, sjaaman - using except in the srfi-1 import should indeed by sufficient.
comment:6 Changed 16 years ago by
| Cc: | sjamaan added |
|---|
Can someone take care of this, and close the ticket? Ivan, if it's ok for you, could sjamaan apply the patch?
comment:7 Changed 16 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
I have applied the patch in r15197.

test case