stevedekorte/io — Issue #154: map scope is smaller than it should be
Author: mcandre
Created: 2011-10-13 00:43:07+00:00
State: open

In [IoCheck](https://github.com/mcandre/IoCheck), `IoCheck forAll` should print `***Failed!` for failing test cases and `+++ OK` for successful test cases. Instead, it's printing both out for failing test cases.

I believe the problem is due to `map` not setting the `failed` variable properly. It appears `map` doesn't see that the variable already exists. If so, `map` is not acting like a true closure. In most languages with a `map` function, it's expected to be able to read and write to variables in the enclosing scope.

Or am I doing something wrong?