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
[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: -- (:)
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

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: