Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Bug somewhere...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-10-08 (21:27)
From: Eric C. Cooper <ecc@c...>
Subject: Re: [Caml-list] Bug somewhere...
On Tue, Oct 08, 2002 at 10:07:01PM +0200, Pierre Weis wrote:
> A lot of problems in here: some are due to the semantics of the Scanf
> module some are due to the implementation, some are even deeper than
> those two!
> ... 
> To solve this problem, you should use bscanf and an explicitely
> allocated input buffer that would survive from one call to scanf to
> the next one. Considering that this phenomenon is general concerning
> stdin and scanf, I rewrote the scanf code such that it allocates a
> buffer once and for all. Hence this problem is solved in the working
> sources.

In the C stdio library, this is solved by ungetc() (push back an
already-read character).  That might be a useful addition to the
operations on in_channels.

Eric C. Cooper          e c c @ c m u . e d u
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: