Summary
parameterize doesn't restore current-{input,output,error}-port correctly
Metadata
- Id: cf52b929d5245ea3df1e61a85e913dfa7892b944
- Trac id: 1285
- Type: defect
- Reporter: evhan
- Owner:
- Cc:
- Status: closed
- Component: unknown
- Estimated difficulty:
- Resolution: fixed
- Priority: critical
- Milestone: 4.11.0
- Version: 4.10.x
- Changetime: 2016-05-22 13:41:37 UTC
- Created: 2016-05-06 09:01:36 UTC
- Keywords: parameters, runtime, ports
Description
Because current-input-port et al. ignore the convert? and set? arguments that are passed to them when they're called from the expansion of parameterize, their values are not restored properly when the parameterize expression ends.
Specifically, this is because the expansion's before thunk calls these procedures with the convert? argument set to #t and set? set to #f in order to invoke the object's (nonexistent) converter procedure without setting its value, but this has the effect of setting the port's value anyway since the ports don't know about these extra arguments.
(parameterize ((current-output-port (current-error-port))) (current-output-port))
There may be other parameter-like objects that aren't really parameters that exhibit this problem.
Changes and comments
[2016-05-06 09:09:11 UTC] sjamaan changed milestone from someday to 4.11.0
[2016-05-16 13:13:50 UTC] sjamaan wrote:
[2016-05-22 13:41:37 UTC] sjamaan changed status from new to closed
[2016-05-22 13:41:37 UTC] sjamaan set resolution to fixed
[2016-05-22 13:41:37 UTC] sjamaan wrote:
Fixed by several commits: 9ace4ecce1445b795116066e2696cae29aeacdd3, 89408e4109d86c34257b83950c4d640714fe5974 (master), 1c4841202bd11c8e8d81769a2c8f5aacdc8c9a48, 7c14fd6df17c3b7a6f4d2639c5218cce0246e5d9 (prerelease), fdfdfc808704e53a8eebbd30d00fd79c6a2710a0 and f6e8bb8516bf6b34c54913ed9545d425ad875a9e (chicken-5)