Browse thread
[Caml-list] Question
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | skaller <skaller@o...> |
| Subject: | Re: [Caml-list] Question |
On Thu, 2003-12-11 at 20:52, Luc Maranget wrote: > To conclude adopting the Felix way in Ocaml is by no mean a trivial > change and benefits are unclear, how many programs do realy use this > feature ? Well, none in Ocaml because it isn't present :-) I have occasionally wanted this, but there is always a workaround. Basically, I think it would be useful in the following situation: match x with | A | (B (j,k) when j=k) -> | B (j,k) -> Without a nested when clause, you could code let handler () = ... in match x with | A -> handler () | B (j,k) when j = k -> handler () | B (j,k) -> ... delocalising the handler. (I have matches several pages long, so this is annoying). Also useful would be: match x with | A i | B (i,k) when i = k -> ... i .. though I can't see a way to generalise that. ------------------- 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