From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 8BD5DBBBB for ; Mon, 13 Mar 2006 07:43:24 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k2D6hNgg000314 for ; Mon, 13 Mar 2006 07:43:24 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id HAA29100 for ; Mon, 13 Mar 2006 07:43:23 +0100 (MET) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k2D6hMAH011951 for ; Mon, 13 Mar 2006 07:43:22 +0100 Received: from frontend1.internal (mysql-sessions.internal [10.202.2.149]) by frontend1.messagingengine.com (Postfix) with ESMTP id BF612D40235 for ; Mon, 13 Mar 2006 01:43:20 -0500 (EST) Received: from frontend3.messagingengine.com ([10.202.2.152]) by frontend1.internal (MEProxy); Mon, 13 Mar 2006 01:43:20 -0500 X-Sasl-enc: ssDTC4AVXXZfEQbMpFKyUe8a15lDbnMUxwSQSQY3uKAz 1142232198 Received: from [172.16.13.143] (burnham.ljcrf.edu [192.231.106.2]) by frontend3.messagingengine.com (Postfix) with ESMTP id AE0D64D5 for ; Mon, 13 Mar 2006 01:43:14 -0500 (EST) Date: Sun, 12 Mar 2006 22:40:51 -0800 (PST) From: Martin Jambon X-X-Sender: martin@droopy To: caml-list@inria.fr Subject: Announcement: pa_bounds Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at concorde with ID 4415148C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4415148A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; syntax:01 syntax:01 arrays:01 bigarrays:01 ocaml:01 bigarray:01 camlp:01 -native:01 -native:01 -unsafe:01 compiler:01 ocamlopt:01 ocamlc:01 findlib:01 camlp:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 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