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
break and continue for OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-04-10 (20:35)
From: Eric Cooper <ecc@c...>
Subject: Re: [Caml-list] break and continue for OCaml
On Thu, Apr 10, 2008 at 10:59:16AM +0900, Sanghyeon Seo wrote:
> I have the first cut of patch to implement break and continue inside
> for and while loops for OCaml.
> ...
> What do you think?


It adds more imperative baggage to the language, going against its
"mostly functional" style.  And it doesn't add any expressive power,
since you can easily use exceptions, or bool refs as in Pascal, to
achieve the same effect.

The syntax and semantics would become more much complicated and
irregular.  As others have pointed out, it's not even clear what a lot
of cases should mean.

If you want richer control structures, continuations and call/cc would
be much more in the functional spirit.

Eric Cooper             e c c @ c m u . e d u