Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
environment idiom
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Re: environment idiom
On Thu, Dec 09, 2004 at 03:12:25PM +0200, Ville-Pertti Keinonen wrote:
> On Thu, 2004-12-09 at 09:09 +0000, Richard Jones wrote:
> > Just an observation here:
> > 
> > The object method seems to be compile-time safe, whereas the hash
> > method seems to require run-time checks which could fail.  Am I right
> > in thinking this?  If so, the compile-time safe version is infinitely
> What run-time checks?  OCaml is statically typed, it has no run-time
> type checking.  Only things like array bounds are checked at run-time.
> The hash method is typed similarly to the following:

I was talking about the use of the Hashtbl.  Hashtbl.find can throw a
Not_found error at runtime if the environment happens not to contain
the required data.  This is a sort of runtime check.


Richard Jones.
>>> - collaboration tools for teams   <<<
Merjis Ltd. - improving website return on investment - CRM consultancy