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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David MENTRE <dmentre@l...>
Subject: Re: [Caml-list] assertions or exceptions?
John Prevost <j.prevost@gmail.com> writes:

> An example of one place in the OCaml standard libraries where I get
> irked is with various container data-structures where searching for an
> item raises "Not_found" when the item is not in the structure.  From
> my point of view, not finding something is very much expected
> behavior.

Please notice that in that very specific case you have the "mem"
function (e.g. Hashtbl.mem) that gives you the opportunity to check for
the element if you expect it missing.

Yours,
d.
-- 
 David Mentré <dmentre@linux-france.org>

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