From: Martin Jambon <martin_jambon@emailuser.net>
To: caml-list@inria.fr
Subject: Announcement: pa_bounds
Date: Sun, 12 Mar 2006 22:40:51 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.63.0603122226450.26326@droopy> (raw)
As suggested by Rich Jones, here is a better description of this new
syntax extension:
pa_bounds syntax extension
==========================
Location-specific reports of out-of-bounds accesses in arrays, strings and
bigarrays.
http://martin.jambon.free.fr/ocaml.html#bounds
What it provides:
----------------
The default behavior of out-of-bounds array, string or bigarray accesses
is to raise the Invalid_argument exception, with no information on where
the faulty access was attempted.
This Camlp4 module provides a special syntax which allows the illegal
accesses to be reported accurately, by indicating the location
in the source code. The same exception, Invalid_argument, is raised, but
its argument is a string which contains that information.
The syntax:
----------
Replace the dot (.) by the number sign (#), e.g.:
native extension
a.(i) a#(i)
a.(i) <- e a#(i) <- e
s.[i] s#[i]
s.[i] <- c s#[i] <- c
big.{i,j} big#{i,j}
big.{i,j} <- x big#{i,j} <- x
It should also work with the revised syntax, where ":=" replaces "<-".
Options:
-------
-native
The native behavior can be restored without changing the program by
passing the -native option to the preprocessor. For unsafe access
without bound checking, this option must be used in addition to the
-unsafe option that can be passed to the compiler (ocamlopt or ocamlc).
Installation:
------------
Install Findlib and P4ck, and then install it from P4ck.
Alternatively, you can compile the extension as follows:
camlp4o -o ocamlc -c \
-pp 'camlp4o pa_extend.cmo q_MLast.cmo -loc _loc' \
-I +camlp4 pa_bounds.ml
See http://www.ocaml-tutorial.org/compiling_ocaml_projects for
information on how to compile programs that use Camlp4 extensions.
License:
-------
BSD-style, see http://martin.jambon.free.fr/pa_bounds/pa_bounds.ml.html
Martin
--
Martin Jambon, PhD
http://martin.jambon.free.fr
Edit http://wikiomics.org, bioinformatics wiki
reply other threads:[~2006-03-13 6:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=Pine.LNX.4.63.0603122226450.26326@droopy \
--to=martin_jambon@emailuser.net \
--cc=caml-list@inria.fr \
/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