From: Henri DF <hen...@ep...> - 2004-04-28 17:58:58
|
hi list, i find myself often having to do [1] if Hashtbl.mem h k then let v = Hashtbl.find h k in ... do stg with k here I was wondering if it would be worth having a Hashtbl.find_opt, which returns Some v if there is a binding, None otherwise. Of course, one could use a ('a, 'b option) Hashtbl.t and then use find_default (with default None) to achieve the same - but that has the overhead of *always* representing values as options. Any thoughts on this? Thanks Henri [1] And of course i could simply wrap Hashtbl.find and catch Not_found, but this is performance sensitive, and i have some vague recollection of there being a cost to putting stuff in a try.. with block. > Hi list, > > Reading the news, it looks like GODI is taking off and that quite huge > developments are being done. That's a nice thing for the ocaml community. > As a window user, I cannot create a GODI package unless I switch to > ocaml/Cygwin. Is there someone here willing to create an maintain the GODI > package for ExtLib.... raise your hands :) > > Regards, > Nicolas Cannasse > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > ocaml-lib-devel mailing list > oca...@li... > https://lists.sourceforge.net/lists/listinfo/ocaml-lib-devel > |