Opened 10 years ago

Closed 10 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)

test.scm (119 bytes) - added by Ivan Raikov 10 years ago.
test case
ssax.diff (1.1 KB) - added by sjamaan 10 years ago.
Patch that is better for maintainability

Download all attachments as: .zip

Change History (9)

Changed 10 years ago by Ivan Raikov

Attachment: test.scm added

test case

comment:1 Changed 10 years ago by Ivan Raikov

Milestone: 4.1.0

comment:2 Changed 10 years ago by felix winkelmann

Component: core librariesextensions
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 10 years ago by Ivan Raikov

Resolution: fixed
Status: newclosed

As ssax already imports srfi-1, I have removed its own definition of fold.

comment:4 Changed 10 years ago by sjamaan

Resolution: fixed
Status: closedreopened

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.

Changed 10 years ago by sjamaan

Attachment: ssax.diff added

Patch that is better for maintainability

comment:5 Changed 10 years ago by felix winkelmann

Thanks for the tip, sjaaman - using except in the srfi-1 import should indeed by sufficient.

comment:6 Changed 10 years ago by felix winkelmann

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 10 years ago by Ivan Raikov

Resolution: fixed
Status: reopenedclosed

I have applied the patch in r15197.

Note: See TracTickets for help on using tickets.