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] How to read three integers from a text-file... ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-04-24 (18:46)
From: Tomasz Zielonka <zielony@c...>
Subject: Re: [Caml-list] How to read three integers from a text-file... ?
On Wed, Apr 24, 2002 at 12:44:37PM +0200, Stefano Lanzavecchia wrote:
> > Moreover in such contests the use of external libraries (Str) if often
> > forbidden.
> Well, in that case the use of scanf should be prohibited too. Str is
> part of the standard OCaml distributed library and it's in no way
> different from scanf.

They are different with regard to typical contest rules, which are
simple (maybe too simple).

Those rules describe commands, which will be used to compile programs,

C        - gcc source.c
OCaml    - ocamlopt

The C program can use scanf, which is in libc. The OCaml program can't
use Str.

> While it's certainly easy to rewrite parts of Str in OCaml (and the
> source code is available),

Str source code is mainly C, not OCaml.

> your students would probably find a bit harder to recode scanf in pure
> C...

scanf source is available too and it is probably C.

And I wouldn't say that implementing regular expression matching library
is easier than implementing scanf.


sig outdated
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: