Summary

Local definition of fold overwrites srfi-1 definition

Metadata

Attachments

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.

Changes and comments

[2009-07-06 05:02:00 UTC] iraikov attached test.scm (description=test case)

[2009-07-06 05:04:27 UTC] iraikov set milestone to 4.1.0

[2009-07-06 10:52:48 UTC] felix set keywords to ssax

[2009-07-06 10:52:48 UTC] felix removed version 4.0.x

[2009-07-06 10:52:48 UTC] felix changed component from core libraries to extensions

[2009-07-06 10:52:48 UTC] felix removed milestone 4.1.0

[2009-07-06 10:52:48 UTC] felix wrote:

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.

[2009-07-08 01:51:59 UTC] iraikov wrote:

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

[2009-07-08 01:51:59 UTC] iraikov changed status from new to closed

[2009-07-08 01:51:59 UTC] iraikov set resolution to fixed

[2009-07-08 09:12:18 UTC] sjamaan changed status from closed to reopened

[2009-07-08 09:12:18 UTC] sjamaan removed resolution fixed

[2009-07-08 09:12:18 UTC] sjamaan wrote:

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.

[2009-07-08 09:12:50 UTC] sjamaan attached ssax.diff (description=Patch that is better for maintainability)

[2009-07-08 10:55:38 UTC] felix wrote:

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

[2009-07-25 23:24:27 UTC] felix set cc to sjamaan

[2009-07-25 23:24:27 UTC] felix wrote:

Can someone take care of this, and close the ticket? Ivan, if it's ok for you, could sjamaan apply the patch?

[2009-07-26 08:41:32 UTC] iraikov changed status from reopened to closed

[2009-07-26 08:41:32 UTC] iraikov set resolution to fixed

[2009-07-26 08:41:32 UTC] iraikov wrote:

I have applied the patch in r15197.