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.2 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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id C7067BC0A for ; Sat, 24 Mar 2007 13:21:50 +0100 (CET) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.232]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2OCLnLY016411 for ; Sat, 24 Mar 2007 13:21:50 +0100 Received: by wr-out-0506.google.com with SMTP id 60so1269811wri for ; Sat, 24 Mar 2007 05:21:49 -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=lDyTxHQTs6b78RPvjYDgD90fbKQFsKV7PY/40ajiwjmfftJhe++ToGfEyxYvC/moZ5kzfqpzH5GXKGPomriz3Trxsk2+W0X0nLxtgGkm0E36ous7DmOPbmT7gSMYia1hjYhcuzXZVdvZpl0fh/6VgwIOkUXetc4PNhxXI+aHnCg= 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=LRNuOM1V4mV1Xi/vhNTtWKEmQczyfB5Ki8q4m7+0fdttARBg7cPMCkWp7f7FZmc+F2Z7kyB7346tPStuBSYlkqi8tGi5ScPe26bKevPfhEtEQ09r7Qfg/C4eoHEOm1qdXKgapX6fDn9iZJAWOF1TJA+5vA9u9df7Rswlf+qbiFI= Received: by 10.114.136.1 with SMTP id j1mr1682201wad.1174738908589; Sat, 24 Mar 2007 05:21:48 -0700 (PDT) Received: by 10.114.183.4 with HTTP; Sat, 24 Mar 2007 05:21:48 -0700 (PDT) Message-ID: Date: Sat, 24 Mar 2007 13:21:48 +0100 From: "Nicolas Pouillard" To: "Martin Jambon" Subject: Re: [Caml-list] Camlp4 3.10.0+beta: lists without $list:...$ Cc: caml-list@inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-j-chkmail-Score: MSGID : 460517DD.001 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 460517DD.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 ens-lyon:01 ens-lyon:01 camlp:01 syntax:01 bug:01 intentional:01 bug:01 manipulates:01 diffs:01 syntax:01 mutable:01 ctyp:01 mutable:01 flags:01 On 3/23/07, Martin Jambon wrote: > On Fri, 23 Mar 2007, Nicolas Pouillard wrote: > > > On 3/23/07, Martin Jambon wrote: [...] > > > > BTW, have you read these slides > > http://gallium.inria.fr/~pouillar/pub/camlp4/renovation-camlp4-longue.pdf Oops I don't remember that was in French (sorry for those that can't read it) > OK, I am trying to convert my syntax extensions and everyday I hit a new > problem, which by default I report as a bug because if it's not documented > as an intentional incompatiblity, it must be a bug. Yes I understand your point, but that's why I pointed out these slides that talk about many of these features, even if it's from a presentation point of view. > I started with pa_json_static.ml > (from http://martin.jambon.free.fr/json-static.html) > because it's fairly complete and doesn't use any dirty trick. > It manipulates all kinds of types, each of them as exprs, patts and ctyps. > So I guess once this works, it would be a big progress toward upgrading > all my stuff. > > I'll publish the commented diffs as soon as I get a version that works, > but it would be much faster if you could do it for me. The thing is I > don't really know how I can help. If I start traducing all camlp4 extensions (or the first of everyone), I'm not done! Perhaps there is a need for some consulting services on camlp4 :) > For now I am stuck with record type definitions: > With quotations in the revised syntax (command camlp4orf), how to create a > record field with an optional mutable flag? > > <:ctyp< $name$ : $opt:is_mutable$ $t1$ >> Generally all flags: private, mutable, virtual, rec, .., to/downto now have their own antiquotation. <:expr< let $rec:is_rec$ f f = f in f >> <:class_str_item< value $mutable:is_mutable$ x = 42 >> <:ctyp< < meth1 : int ; meth2 : float $..:raw_variable$ > >> ... However there is some exceptions to that rule. A private type is a type surrounded by a node "private". That's now the same thing for mutable types. You can define this function if you want: let mkmutable is_mutable = if is_mutable then <:ctyp< mutable $t$ >> else t Or rewrite a little the code to take a better profit of this change. BTW: camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml contains many of your answers. Best regards, -- Nicolas Pouillard