Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] OCaml wishlist
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alain.Frisch@e...
Subject: Re: [Caml-list] OCaml wishlist
On Tue, 21 Oct 2003, William Lovas wrote:

> I don't think it would be beneficial in the long run to clutter up the core
> language with these sorts of purely syntactic issues

Not quite. Even without escaping loops, the "return" statement is more
than syntax. Consider:

let f x =
  ...
  match .. with
   | .. ->
       let .. = (if ... then return "Booh!" else ...)

In some cases, GOTOs^Wstatic exceptions are just a decent solution to
shortcut the normal functional control flow, and much more efficient than
dynamic exceptions. Internally, OCaml has such a mechanism (see
bytecomp/lambda.mli, Lstatic* constructors, used for the compilation of
pattern matching), which, I guess, could be quite easily be exposed in a
type-safe way to the surface language. Note that I'm not really asking for
such a feature.

-- Alain

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