caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Worsening standard library
@ 2004-11-03 21:11 Serge
  2004-11-03 21:21 ` [Caml-list] " David Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Serge @ 2004-11-03 21:11 UTC (permalink / raw)
  To: caml-list


Gentlemen!

I think this might be kinda offtopic, but nevertheless. OCaml is being
extensively employed for educational purposes, and it looks like it is
still missing an important feature - the one of easy reading numbers
(integers/floats/doubles) from, say, standard input. You have to read
lines and parse numbers out of them. For instance, in Pascal it was
possible to do "read(x)". 

Absence of such feature distracts people from trying to program sensible
things in OCaml. It would be nice to have such functionality in the
standard library.

I do not wish to start a rant like "let us include simplex method in the
std since it is gravely important" etc., but I do think that _ability to
read numbers from stdin in a standard way_ is very important for the
language like OCaml - because students want it very much, and it is not
ugly in any way.

-------------------------------------------------------------------------------
 Serge S. Bityukov, Moscow State University, Dept of Mechanics and Mathematics



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

* Re: [Caml-list] Worsening standard library
  2004-11-03 21:11 Worsening standard library Serge
@ 2004-11-03 21:21 ` David Brown
  2004-11-03 21:37   ` Serge
  2004-11-03 22:31 ` Manos Renieris
  2004-11-03 23:22 ` sejourne_kevin
  2 siblings, 1 reply; 5+ messages in thread
From: David Brown @ 2004-11-03 21:21 UTC (permalink / raw)
  To: Serge; +Cc: caml-list

On Thu, Nov 04, 2004 at 12:11:08AM +0300, Serge wrote:

> I do not wish to start a rant like "let us include simplex method in the
> std since it is gravely important" etc., but I do think that _ability to
> read numbers from stdin in a standard way_ is very important for the
> language like OCaml - because students want it very much, and it is not
> ugly in any way.

Any reason not to use 'scanf'?

Dave


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

* Re: [Caml-list] Worsening standard library
  2004-11-03 21:21 ` [Caml-list] " David Brown
@ 2004-11-03 21:37   ` Serge
  0 siblings, 0 replies; 5+ messages in thread
From: Serge @ 2004-11-03 21:37 UTC (permalink / raw)
  To: David Brown; +Cc: caml-list


> Any reason not to use 'scanf'?

Complexity. I do not mind having scanf, but using it requires
some understanding of modules, format strings and polymorphic types. And
people are unlikely to get bothered by these as soon as they are unable to
feed numbers into their simple programs. That's the catch. Reading numbers
should hardly be more complicated than reading strings, IMHO.

-------------------------------------------------------------------------------
 Serge S. Bityukov, Moscow State University, Dept of Mechanics and Mathematics


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

* Re: [Caml-list] Worsening standard library
  2004-11-03 21:11 Worsening standard library Serge
  2004-11-03 21:21 ` [Caml-list] " David Brown
@ 2004-11-03 22:31 ` Manos Renieris
  2004-11-03 23:22 ` sejourne_kevin
  2 siblings, 0 replies; 5+ messages in thread
From: Manos Renieris @ 2004-11-03 22:31 UTC (permalink / raw)
  To: Serge; +Cc: caml-list

read_int
read_line
read_float 

are all in Pervasives.

-- Manos

On Thu, Nov 04, 2004 at 12:11:08AM +0300, Serge wrote:
> 
> Gentlemen!
> 
> I think this might be kinda offtopic, but nevertheless. OCaml is being
> extensively employed for educational purposes, and it looks like it is
> still missing an important feature - the one of easy reading numbers
> (integers/floats/doubles) from, say, standard input. You have to read
> lines and parse numbers out of them. For instance, in Pascal it was
> possible to do "read(x)". 
> 
> Absence of such feature distracts people from trying to program sensible
> things in OCaml. It would be nice to have such functionality in the
> standard library.
> 
> I do not wish to start a rant like "let us include simplex method in the
> std since it is gravely important" etc., but I do think that _ability to
> read numbers from stdin in a standard way_ is very important for the
> language like OCaml - because students want it very much, and it is not
> ugly in any way.
> 
> -------------------------------------------------------------------------------
>  Serge S. Bityukov, Moscow State University, Dept of Mechanics and Mathematics
> 
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


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

* Re: [Caml-list] Worsening standard library
  2004-11-03 21:11 Worsening standard library Serge
  2004-11-03 21:21 ` [Caml-list] " David Brown
  2004-11-03 22:31 ` Manos Renieris
@ 2004-11-03 23:22 ` sejourne_kevin
  2 siblings, 0 replies; 5+ messages in thread
From: sejourne_kevin @ 2004-11-03 23:22 UTC (permalink / raw)
  To: Serge; +Cc: caml-list

Serge a écrit :
> Gentlemen!
> 
> I think this might be kinda offtopic, but nevertheless. OCaml is being
> extensively employed for educational purposes, and it looks like it is
> still missing an important feature - the one of easy reading numbers
> (integers/floats/doubles) from, say, standard input. You have to read
> lines and parse numbers out of them. For instance, in Pascal it was
> possible to do "read(x)". 
There is some functions for doing that:
Pervasives.read_line
Pervasives.read_int
Pervasives.read_float



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

end of thread, other threads:[~2004-11-03 22:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-03 21:11 Worsening standard library Serge
2004-11-03 21:21 ` [Caml-list] " David Brown
2004-11-03 21:37   ` Serge
2004-11-03 22:31 ` Manos Renieris
2004-11-03 23:22 ` sejourne_kevin

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).