caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] How to read three integers from a text-file... ?
@ 2002-04-23 10:41 Jacek Chrzaszcz
  2002-04-24 10:44 ` Stefano Lanzavecchia
                   ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: Jacek Chrzaszcz @ 2002-04-23 10:41 UTC (permalink / raw)
  To: caml-list


Hello list,

Is there a clean way (a one-liner) to read a constant number of
integers separated by whitespace from a text-file (or stdin) ?

I mean something like 
scanf("%d%d%d",&a,&b,&c) in C, or
readln(a,b,c) in Pascal

I know I can use String.index, Str.split or read char by char (this
sucks), but you have to admit the Pascal or even C versions are more
appealing.


I am asking this question, because our students want to use Ocaml for
competing in various programming contests, where the comfort and speed
(of programming) are essential.

Moreover in such contests the use of external libraries (Str) if often
forbiden.


If the easy way of doing this is missing, may I suggest adding it to
the standard library?


Jacek Chrzaszcz
-------------------
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


^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2002-05-13 20:00 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-23 10:41 [Caml-list] How to read three integers from a text-file... ? Jacek Chrzaszcz
2002-04-24 10:44 ` Stefano Lanzavecchia
2002-04-24 18:46   ` Tomasz Zielonka
2002-04-24 11:16 ` Jacques Garrigue
2002-04-24 13:40   ` Tomasz Zielonka
2002-04-25  5:30   ` pervasives (was: Re: [Caml-list] How to read three integers from a text-file... ?) Chris Hecker
2002-04-25  6:33     ` Tomasz Zielonka
2002-04-25 17:54       ` Chris Hecker
2002-04-27  4:43         ` John Max Skaller
2002-04-27 16:02           ` [Caml-list] input_line (Re: pervasives) Lauri Alanko
2002-04-30 12:07             ` [Caml-list] input_line Xavier Leroy
2002-05-03  0:13               ` Lauri Alanko
2002-05-03 11:27                 ` Florian Hars
2002-04-24 21:23 ` [Caml-list] How to read three integers from a text-file... ? Tomasz Zielonka
2002-04-25  1:51   ` John Max Skaller
2002-04-25  8:55   ` Daniel de Rauglaudre
2002-04-25 11:19     ` Markus Mottl
2002-04-25 11:33       ` Jérôme Marant
2002-04-25 11:43         ` Markus Mottl
2002-04-25 17:56         ` Chris Hecker
2002-04-25 20:52           ` John Prevost
2002-04-25 23:32           ` Jacques Garrigue
2002-04-26  7:25             ` Jérôme Marant
2002-04-26 12:16           ` Jacques Garrigue
2002-05-02  8:48             ` Jacques Garrigue
2002-04-26  1:39         ` Daniel de Rauglaudre
2002-04-29  6:44   ` Francois Pottier
2002-04-30 11:07     ` Dave Berry
2002-04-30 12:20       ` Francois Pottier
2002-04-30 13:54         ` T. Kurt Bond
2002-05-03 22:12         ` Dave Berry
2002-04-30 14:42       ` Jocelyn Sérot
2002-05-02  7:34         ` [Caml-list] Extensible tuple types Francois Pottier
2002-05-02  9:42           ` Alain Frisch
2002-05-02 11:03             ` Francois Pottier
     [not found]       ` <6ECF4649-5C48-11D6-AC27-0003934491C2@lasmea.univ-bpclermon t.fr>
2002-05-03 21:58         ` [Caml-list] How to read three integers from a text-file... ? Dave Berry
2002-05-06  0:53           ` Eray Ozkural
2002-05-06  6:40           ` Florian Hars
2002-04-30 23:30     ` [Caml-list] Danvy "Functional Unparsing" style output in OCaml [was: How to read three integers from a text-file... ?] T. Kurt Bond
2002-05-13 14:11       ` [Caml-list] RE: Danvy "Functional Unparsing" style output in OCaml T. Kurt Bond
2002-05-13 19:59         ` [Caml-list] "Functional Unparsing" benchmark results links fixed [Was: Danvy "Functional Unparsing" style output in OCaml] T. Kurt Bond

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).