From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA29969; Tue, 8 Oct 2002 23:27:00 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA29936 for ; Tue, 8 Oct 2002 23:26:59 +0200 (MET DST) Received: from ux9.sp.cs.cmu.edu (UX9.SP.CS.CMU.EDU [128.2.220.166]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id g98LQuD08212 for ; Tue, 8 Oct 2002 23:26:58 +0200 (MET DST) Received: from 12-226-42-149.client.attbi.com ([12.226.42.149]) by ux9.sp.cs.cmu.edu id aa02842; 8 Oct 2002 17:26 EDT Received: from ecc by stratocaster.home with local (Exim 3.36 #1 (Debian)) id 17z1rp-00045z-00 for ; Tue, 08 Oct 2002 17:26:13 -0400 Date: Tue, 8 Oct 2002 17:26:13 -0400 To: caml-list@inria.fr Subject: Re: [Caml-list] Bug somewhere... Message-ID: <20021008212613.GA15590@stratocaster.home> Mail-Followup-To: caml-list@inria.fr References: <3DA0C1F3.5010308@baretta.com> <200210082007.WAA27767@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200210082007.WAA27767@pauillac.inria.fr> User-Agent: Mutt/1.4i From: "Eric C. Cooper" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners