From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 66728BBC1 for ; Tue, 19 Feb 2008 20:34:35 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAALq9ukeAKs6Bimdsb2JhbACQUAEBAQgEBQoIGJ42 X-IronPort-AV: E=Sophos;i="4.25,377,1199660400"; d="scan'208";a="8290367" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 19 Feb 2008 20:34:35 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1JJYYXH003616 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 19 Feb 2008 20:34:35 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAALq9ukeAKs6Bimdsb2JhbACQUAEBAQgEBQoIGJ42 X-IronPort-AV: E=Sophos;i="4.25,377,1199660400"; d="scan'208";a="8290366" Received: from smtp2.mail.rice.edu (HELO mh1.mail.rice.edu) ([128.42.206.129]) by mail1-smtp-roc.national.inria.fr with ESMTP; 19 Feb 2008 20:34:34 +0100 Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id DB6F1130065 for ; Tue, 19 Feb 2008 13:34:32 -0600 (CST) X-Virus-Scanned: by amavis-2.4.4 at mh1.mail.rice.edu Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IatEziQY8VMu for ; Tue, 19 Feb 2008 13:34:32 -0600 (CST) Received: from echinuz.oplink.net (66-100-224-29-dyndsl.oplink.net [66.100.224.29]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh1.mail.rice.edu (Postfix) with ESMTP id 8F32313005B for ; Tue, 19 Feb 2008 13:34:32 -0600 (CST) Date: Tue, 19 Feb 2008 13:32:18 -0600 (CST) From: Joseph Young X-X-Sender: josyoun@echinuz.oplink.net To: caml-list@inria.fr Subject: Bug with camlp5 and Bigarray Access Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at concorde with ID 47BB2F4A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bug:01 camlp:01 bigarray:01 camlp:01 bigarray:01 ocamlc:01 bug:01 preprocess:01 ocamlc:01 -pp:01 elt:01 -pp:01 preprocess:01 cmo:01 cmo:01 Camlp5 does not appear to handle bigarray access correctly. Consider the following program: let y=Bigarray.Array2.create Bigarray.float64 Bigarray.fortran_layout 5 3;; let z=y.{1,1};; This program compiles correctly with: $ ocamlc bigarray.cma bug.ml -o bug When I preprocess with camlp5o using the command: $ ocamlc -I +camlp5 -pp camlp5o bigarray.cma bug.ml -o bug, I receive the error: File "bug.ml", line 2, characters 6-7: This expression has type (float, Bigarray.float64_elt, Bigarray.fortran_layout) Bigarray.Array2.t but is here used with type ('a, 'b, 'c) Bigarray.Array1.t This only appears to be a problem with camlp5o. Using camlp5r and the program: value y=Bigarray.Array2.create Bigarray.float64 Bigarray.fortran_layout 5 3; value z=y.{1,1}; This appears to compile correctly: $ ocamlc -I +camlp5 -pp camlp5r bigarray.cma bug2.ml -o bug2 Also, when I preprocess the original file using pr_o, things seem to work correctly: camlp5 pa_o.cmo pa_op.cmo pr_o.cmo bug.ml > tmp.ml ocamlc bigarray.cma tmp.ml -o tmp Joe