On Wed, May 24, 2017 at 2:39 PM, Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote:
I have to admit that it is true that also "we" make mistakes when it
comes to the linear-update procedures. The test code of SRFI 113 assumes
that linear-update procedures modify their argument, see e.g. here:
https://github.com/scheme-requests-for-implementation/srfi-113/blob/master/sets/sets-test.scm#L153.
Some volunteer should correct the test cases (or take the SRFI 113 tests
from SRFI 146, where I had to fix it because the linear-update
procedures from the SRFI 146 sample implementation do not change their
argument).

I would like to suggest to take the following steps to make the Scheme
world a bit safer again:

1) The definition of linear update procedures in SRFI 146 should be
stricter by adding the following error conditions explicitly: "It is an
error to reference a (mapping) parameter after a linear-update procedure
has been invoked. It is an error not to reference the result of invoking
a linear-update procedure in its continuation."

I don't think the latter is a good idea, there can be valid uses
even without resorting to call/cc or just running a benchmark.

A nice compiler should probably warn you if it sees the result
unused though.

-- 
Alex