English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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-30 (12:07)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] input_line
> Vaguely related to this, I have some minor gripes about input_line.
> Here's the implementation in 3.04:
> It's obvious that this doesn't handle obnoxiously large newlineless
> inputs very gracefully. Its complexity is quadratic and it's not tail
> recursive.

input_line was reimplemented in the working sources to avoid the
quadratic behavior you mention.

> And worst of all, there are no limits on the size of string
> to be created. So a maliciously designed huge input could blow either
> the stack or the heap. I wouldn't want to use input_line in a network
> application.

I see your point, but there are other (most?) applications where you
really do not want to have any hard limits beyond available memory.

- Xavier Leroy
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