From: Blair Z. <bl...@or...> - 2003-03-11 01:51:49
|
Nicolas Cannasse wrote: > > Okay, so perhaps somethink like : > > let val_of = function > | None -> failwith "val_of" > | Some x -> x > > is what you need ? > But since I think some people will still want to catch the exception and use > try...with instead of an easier pattern matching ( perhaps catching the > exception to an upper level can be useful sometimes ), I would prefer : > > exception ValNone > > let val_of = function > | None -> raise ValNone > | Some x -> x Sounds good to me. So this way if you see a ValNone exception, you know that you're not handling something that should be handled. Best, Blair -- Blair Zajac <bl...@or...> Plots of your system's performance - http://www.orcaware.com/orca/ |