Previous week Up Next week


Here is the latest Caml Weekly News, for the week of 10 to 17 February, 2004.

  1. Resizable arrays

Resizable arrays

Chris GauthierDickey asked and Markus Mottl answered:
> 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.

Using folding to read the cwn in vim 6+

Here is a quick trick to help you read this CWN if you are viewing it using vim (version 6 or greater).

:set foldmethod=expr
:set foldexpr=getline(v:lnum)=~'^=\\{78}$'?'<1':1

If you know of a better way, please let me know.

Old cwn

If you happen to miss a CWN, you can send me a message and I'll mail it to you, or go take a look at the archive or the RSS feed of the archives.

If you also wish to receive it every week by mail, you may subscribe online.

Alan Schmitt