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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 34F8FBC0A for ; Tue, 17 Apr 2007 19:50:38 +0200 (CEST) Received: from hub.hrl.com (hub.hrl.com [208.179.241.200]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3HHobb3000856 for ; Tue, 17 Apr 2007 19:50:37 +0200 Received: from [192.27.172.110] (dangle.hrl.com [192.27.172.110]) by hpux03.hrl.com (iPlanet Messaging Server 5.2 HotFix 2.10 (built Dec 26 2005)) with ESMTP id <0JGN004JVLKCSG@hpux03.hrl.com> for caml-list@inria.fr; Tue, 17 Apr 2007 10:50:36 -0700 (PDT) Date: Tue, 17 Apr 2007 10:50:36 -0700 From: Aleksey Nogin Subject: 3.10+beta: Camlp4: AST mapping treats record labels as patterns; should they have type ident instead? To: Caml List Reply-To: Caml List , Aleksey Nogin Message-id: <462508EC.2090302@metaprl.org> Organization: MetaPRL/Mojave Research Group MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Thunderbird 1.5.0.10 (X11/20070301) X-Miltered: at concorde with ID 462508ED.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 camlp:01 defines:01 expr:01 expr:01 arbitrary:01 patt:01 patt:01 define:01 ident:02 ident:02 caml:02 ast:02 ast:02 binding:02 Currently Camlp4 AST defines the record patterns as PaRec of loc and list (patt * patt) and record expressions as ExRec of Loc.t and binding and expr where the binding can bind arbitrary patterns to expressions. This was not a big issue prior to 3.10, but now that 3.10 provides very powerful mapping and folding features, this seems a bit problematic. Namely, if I define a Camlp4 filter or an AST mapping function that affects patterns, the array labels will get affected as well, often in an undesired way. Would it be better to have PaRec of loc and list (ident * patt) and ExRec of loc and list (ident * expr) and expr instead? If so, it would seem that now is the time to make the change, as 3.10 is about to make major backwards-incompatible camlp4 changes anyway. Aleksey P.S. I've also filed this as http://caml.inria.fr/mantis/view.php?id=4263