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=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 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 58A4FBC6B for ; Fri, 1 Jun 2007 15:30:32 +0200 (CEST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l51DUU5h009363 for ; Fri, 1 Jun 2007 15:30:31 +0200 Received: by wa-out-1112.google.com with SMTP id n7so734348wag for ; Fri, 01 Jun 2007 06:30:29 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WF1fnowLQGXIoEMjkpTtgi4XmLxCdMaXhqQZNtKAAZcE4bUw8/XM1OcsBWXLBzZOxazAEjBOdngReq5AAfBRbQlJgfI5PpYJCYPnU75L6O/YIv8jVL4l6jWr2pyu77pslOdpbrsmpSFjTwKgPPIMCFoVrWYXoVhYRVPdygXC6b0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rbELDq6wkXhXkVjdB90L/r+d5OVVsHB9A85jDKWFWRxOkv1IAKyjLUmfOmUuJgT5XeBNm6KpaQcf5l9rx29m3PVA51+rJt5Rx2CC6fj8LIAuYkbeaT1HhkvfOFcN+iFqLSUBBac8ymLxuoVn2/gBIwppsKceWh11R2xGui3mwOk= Received: by 10.114.27.20 with SMTP id a20mr1764006waa.1180704626624; Fri, 01 Jun 2007 06:30:26 -0700 (PDT) Received: by 10.114.181.8 with HTTP; Fri, 1 Jun 2007 06:30:26 -0700 (PDT) Message-ID: Date: Fri, 1 Jun 2007 15:30:26 +0200 From: "Nicolas Pouillard" To: "Joel Reymont" Subject: Re: [Caml-list] Re: GenerateFold Cc: "OCaml List" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5F8F1647-A4A8-4C71-9958-9370C44ECB84@gmail.com> <979C8DFA-180A-4AA2-8D5A-63083BDDAEE7@gmail.com> <534D9E1D-8F72-4972-8F53-DA64CA2DD20B@gmail.com> <465FB7D6.1090805@gmail.com> X-j-chkmail-Score: MSGID : 46601F76.001 on concorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at concorde with ID 46601F76.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; val:01 decl:01 decl:01 byte:01 usr:01 ocamlc:01 camlp:01 -pp:01 cmo:01 bool:01 bool:01 expr:01 expr:01 blog:98 wrote:01 Got it: There is the solution available for meditation :) let is_fun_arg = object inherit fold as super val found = false method found = found method input_decl x = match x with | `FunArgDecl _ -> {< found = true >} | _ -> super#input_decl x end On 6/1/07, Joel Reymont wrote: > I figured it out. The following introduction of order and order_type > [2] triggers the error I was seeing previously [1]. This should be > enough to reproduce the issue and, hopefully, provide clues on how to > fix it. I have no clues, btw. > > Thanks, Joel > > [1] Error > > ocamlbuild c.byte > + /usr/local/bin/ocamlc.opt -c -I +camlp4 -pp 'camlp4of -I src - > filter map -filter fold -filter trash ' -o b.cmo b.ml > File "ghost-location", line 1, characters 0-0: > This expression has type > < array : 'b. ('a -> 'b -> 'a) -> 'b array -> 'a; bool : bool -> 'a; > expr : A.expr -> 'a; float : float -> 'a; id : A.id -> 'a; > input_decl : A.input_decl -> 'a; int : int -> 'a; > list : 'c. ('a -> 'c -> 'a) -> 'c list -> 'a; > option : 'd. ('a -> 'd -> 'a) -> 'd option -> 'a; order : > A.order -> 'a; > order_type : A.order_type -> 'a; program : A.program -> 'a; > ref : 'e. ('a -> 'e -> 'a) -> 'e ref -> 'a; > statement : A.statement -> 'a; string : string -> 'a; > subscript : A.subscript -> 'a; ty : A.ty -> 'a; .. > > as 'a > but is here used with type A.order_type > > [2] Code with order and order_type. > > type id = string > > and program = statement list > > and ty = > [ > | `TyAny > ] > > and statement = > [ > | `Skip > | `InputDecls of input_decl list > ] > > and subscript = expr list > > and input_decl = > [ > | `InputDecl of id * ty * expr > | `FunArgDecl of id * ty * subscript > ] > > and expr = > [ > | `Int of int > | `Float of float > | `Str of string > ] > > and order = { > order_type: order_type; > } > > and order_type = > [ > | `Buy > | `Sell > | `Short > | `Cover > ] > > > > -- > http://topdog.cc - EasyLanguage to C# translator > http://wagerlabs.com - Blog > -- Nicolas Pouillard