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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-12-10 (11:59)
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.  http://www.annexia.org/  http://www.j-london.com/
>>>   http://www.team-notepad.com/ - collaboration tools for teams   <<<
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
http://winwinsales.co.uk/ - CRM consultancy