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.0 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 25AF2BC69 for ; Thu, 31 May 2007 14:18:53 +0200 (CEST) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.231]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4VCIqSo020334 for ; Thu, 31 May 2007 14:18:52 +0200 Received: by wr-out-0506.google.com with SMTP id 50so133107wra for ; Thu, 31 May 2007 05:18:51 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=BdHc3mhyGYXEaDPN8Pot2OqqLb7taTdNgqO+sn/b5T/9G8PozsHkp7mgQEw7eB7j0r2CxNItUMts3xNNhRhITVsyW9kW4T83T0SyDO/DvKmkWZ2KyJSI6dTc4EAJmLlrN9sC/TFOdz+DFkmQVksf8rwiBlAwwwFISDfhZjWLxPQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=qpLJJV/V71PqXaKErYXejXMN5UzXdN14gkhadwqRpGsNQu221RH0AbqLlVAVw6N6Nb1xzz/+2kZ7jirTy1fYiuFTOVf2Sf+2ZdtSj6nfswx/x64Ub9KLWxzucjRuHqe14yvhs/WyGsbMBfFQgI/nbejhNnXWwwpu9vA55oIIptM= Received: by 10.78.204.7 with SMTP id b7mr349369hug.1180613931148; Thu, 31 May 2007 05:18:51 -0700 (PDT) Received: from ?192.168.1.33? ( [81.32.170.248]) by mx.google.com with ESMTP id 31sm1841883hub.2007.05.31.05.18.49; Thu, 31 May 2007 05:18:50 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5F8F1647-A4A8-4C71-9958-9370C44ECB84@gmail.com> Cc: Nicolas Pouillard Content-Transfer-Encoding: 7bit From: Joel Reymont Subject: GenerateFold Date: Thu, 31 May 2007 13:18:55 +0100 To: OCaml List X-Mailer: Apple Mail (2.752.3) X-j-chkmail-Score: MSGID : 465EBD2C.001 on concorde : j-chkmail score : XXX : 5/20 1 0.000 -> 3 X-Miltered: at concorde with ID 465EBD2C.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; decl:01 decl:01 expr:01 camlp:01 blog:98 inherit:01 ast:02 ast:02 tree:02 match:02 arg:03 arg:03 let:03 let:03 bits:04 What is the proper use of GenerateFold here? What I'm trying to do is dig into my AST tree, starting with a list of statements at the top, to find out if I have any `FunArgDecl bits. At the top of the AST I have statement = [ | `InputDecls of input_decl list ] and then input_decl = [ | `InputDecl of id * ty * expr | `FunArgDecl of id * ty * subscript ] I tried the following approach but it's obviously wrong. class fold = Camlp4Filters.GenerateFold.generated;; let is_fun_arg = object inherit fold as super method input_decl x = match super#input_decl x with | `FunArgDecl _ -> true | _ -> false end let is_fun x = is_fun_arg#statement x;; Thanks, Joel -- http://topdog.cc - EasyLanguage to C# translator http://wagerlabs.com - Blog