Opened 8 years ago

Closed 8 years ago

#1285 closed defect (fixed)

parameterize doesn't restore current-{input,output,error}-port correctly

Reported by: evhan Owned by:
Priority: critical Milestone: 4.11.0
Component: unknown Version: 4.10.x
Keywords: parameters, runtime, ports Cc:
Estimated difficulty:


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

There may be other parameter-like objects that aren't really parameters that exhibit this problem.

Change History (3)

comment:1 Changed 8 years ago by sjamaan

Milestone: someday4.11.0

comment:2 Changed 8 years ago by sjamaan

current-exception-handler also behaves like a parameter (even though that's not explicitly supported there, either)

comment:3 Changed 8 years ago by sjamaan

Resolution: fixed
Status: newclosed

Fixed by several commits: 9ace4ecce1445b795116066e2696cae29aeacdd3, 89408e4109d86c34257b83950c4d640714fe5974 (master), 1c4841202bd11c8e8d81769a2c8f5aacdc8c9a48, 7c14fd6df17c3b7a6f4d2639c5218cce0246e5d9 (prerelease), fdfdfc808704e53a8eebbd30d00fd79c6a2710a0 and f6e8bb8516bf6b34c54913ed9545d425ad875a9e (chicken-5)

Note: See TracTickets for help on using tickets.