Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Markus Mottl <markus@oefai.at>
To: Chris GauthierDickey <chrisg@cs.uoregon.edu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] exception or conditional
Date: Wed, 11 Feb 2004 00:34:21 +0100	[thread overview]
Message-ID: <20040210233421.GA23818@fichte.ai.univie.ac.at> (raw)
In-Reply-To: <4029641D.5050102@cs.uoregon.edu>

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:

  http://www.oefai.at/~markus/home/ocaml_sources.html#RES

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

Regards,
Markus

-- 
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


      reply	other threads:[~2004-02-10 23:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-10 23:07 Chris GauthierDickey
2004-02-10 23:34 ` Markus Mottl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040210233421.GA23818@fichte.ai.univie.ac.at \
    --to=markus@oefai.at \
    --cc=caml-list@inria.fr \
    --cc=chrisg@cs.uoregon.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox