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
[Caml-list] exception or conditional
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-02-10 (23:34)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] exception or conditional
On Tue, 10 Feb 2004, Chris GauthierDickey wrote:
> I'm writing a function that is using an array that can be dynamically 
> resized. I'm wondering if it would be better to just catch an exception 
> if we attempt to go out of bounds in the array (at which point I resize 
> the array), or if I should test the size using an if-then-else before I 
> enter the main body of my function and resize then.

You might be interested in the RES-library, which also implements
resizable arrays while staying compatible to the Array-module:


Bounds checking probably makes less difference to the performance of
your algorithm than you might expect.


Markus Mottl          http://www.oefai.at/~markus          markus@oefai.at

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