From: Jean-Christophe Filliatre <filliatr@lri.fr>
To: Basile STARYNKEVITCH <basile@starynkevitch.net>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] printf & scanf oddity
Date: Fri, 27 Jan 2006 15:57:10 +0100 [thread overview]
Message-ID: <17370.13510.885701.379425@gargle.gargle.HOWL> (raw)
In-Reply-To: <20060127142622.GA8216@ours.starynkevitch.net>
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)
next prev parent reply other threads:[~2006-01-27 14:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-27 14:26 Basile STARYNKEVITCH
2006-01-27 14:57 ` Jean-Christophe Filliatre [this message]
2006-01-27 15:48 ` [Caml-list] " William D. Neumann
2006-01-27 15:03 ` Virgile Prevosto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17370.13510.885701.379425@gargle.gargle.HOWL \
--to=filliatr@lri.fr \
--cc=basile@starynkevitch.net \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox