chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-janitors] #1285: parameterize doesn't restore current-{input, o


From: Chicken Trac
Subject: [Chicken-janitors] #1285: parameterize doesn't restore current-{input, output, error}-port correctly
Date: Fri, 06 May 2016 07:01:36 -0000

#1285: parameterize doesn't restore current-{input,output,error}-port correctly
----------------------------------------+---------------------
 Reporter:  evhan                       |      Owner:
     Type:  defect                      |     Status:  new
 Priority:  critical                    |  Milestone:  someday
Component:  unknown                     |    Version:  4.10.x
 Keywords:  parameters, runtime, ports  |
----------------------------------------+---------------------
 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.

--
Ticket URL: <http://bugs.call-cc.org/ticket/1285>
CHICKEN Scheme <http://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]