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] Question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-12-11 (15:20)
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

	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