From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id D1E56BBBB for ; Fri, 27 Jan 2006 15:57:46 +0100 (CET) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k0REvk7H021979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 27 Jan 2006 15:57:46 +0100 Received: from smtp.lri.fr (serveur3-5 [129.175.3.5]) by ext.lri.fr (Postfix) with ESMTP id 50E0B2024F3; Fri, 27 Jan 2006 15:57:46 +0100 (CET) Received: from pc9-152 (pc9-152 [129.175.9.152]) by smtp.lri.fr (Postfix) with ESMTP id 9287CCED98; Fri, 27 Jan 2006 15:57:45 +0100 (CET) Received: from filliatr by pc9-152 with local (Exim 3.36 #1 (Debian)) id 1F2V2J-0008MO-00; Fri, 27 Jan 2006 15:57:15 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <17370.13510.885701.379425@gargle.gargle.HOWL> Date: Fri, 27 Jan 2006 15:57:10 +0100 To: Basile STARYNKEVITCH Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] printf & scanf oddity In-Reply-To: <20060127142622.GA8216@ours.starynkevitch.net> References: <20060127142622.GA8216@ours.starynkevitch.net> X-Mailer: VM 7.19 under Emacs 21.4.1 From: Jean-Christophe Filliatre X-Virus-Scanned: by amavisd-new at lri.fr X-Miltered: at concorde with ID 43DA34EA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 printf:01 scanf:01 filliatre:01 filliatr:01 lri:01 basile:01 ocaml:01 printf:01 sprintf:01 scanf:01 sscanf:01 char:01 bug:01 3.08.3:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Basile STARYNKEVITCH writes: > > I find the following quite strange: > > % ocaml > Objective Caml version 3.09.1 > > # Printf.sprintf "_a%d_f%d" 1 2;; > - : string = "_a1_f2" > # Scanf.sscanf "_a1_f2" "_a%d_f%d" (fun x y -> x,y);; > Exception: > Scanf.Scan_failure > "scanf: bad input at char number 5: looking for '_', found 'f'". > > Is it a bug, or did I misunderstood something? I think this is the answer :-) ====================================================================== Objective Caml version 3.08.3 # 1_;; - : int = 1 # 1_2_3;; - : int = 123 etc. ====================================================================== See "integer literals" in the manual : http://caml.inria.fr/pub/docs/manual-ocaml/manual009.html But I agree with you: this is wierd and almost a bug... -- Jean-Christophe Filliātre (http://www.lri.fr/~filliatr)