[MLton] Bug: TextPrimIO does not distinguish between EOF and no data

Matthew Fluet fluet at tti-c.org
Thu Dec 13 05:46:36 PST 2007


On Thu, 13 Dec 2007, Ville Laurikari wrote:
> On Wed, Dec 12, 2007 at 11:49:31PM +0200, Vesa Karvonen wrote:
>> The problem seems to be that the canInput implementation in
>> basis-library/io/imperative-io.fun does not distinguish between
>> readArrNB returning NONE (means: eof not seen, any read will block)
>> and SOME 0 (means: eof seen and at eof).
>>
>> Below is a patch that seems to fix the problem.  With the patch, I get
>
> Your patch works for me too, with both bug.sml and my real program.  I
> suggest you commit it.  The logic in canInput after your patch seems
> correct to me.

Someone should check whether similar logic needs to be pushed to the 
StreamIO layer.  (I haven't.)



More information about the MLton mailing list