On 18/09/2011 10:46, Will Robertson wrote:
>> I guess an
>> alternative is to set up the code such that a stream which has been
>> closed will give a suitable error message if one tries to use it.
>
> I prefer this option; I think it's natural to want to write
>
> \iow_new:N \g_foo_iow
> ...
> \cs_new:Nn \foo_internal_something:n
> {
> \iow_open:Nn \g_foo_iow {#1.output}
> ...
> \iow_close:N
> }
That's easy to do, leaving only the question of what happens with
\iow_new:N \l_my_stream
\iow_open:N \l_my_stream { <file> }
...
\iow_close:N \l_my_stream
..
\iow_open:N \l_my_stream { <file> }
The easiest approach is that we just overwrite the <file>.
--
Joseph Wright