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.4 required=5.0 tests=AWL,HTML_MESSAGE,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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id D8E47BC37 for ; Tue, 28 Jul 2009 14:05:49 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqwCAIaGbkrRVdzZkGdsb2JhbACCJi6WdD8BAQEBCQkMBxMDqFOPVAEFhAyBTQ X-IronPort-AV: E=Sophos;i="4.43,283,1246831200"; d="scan'208";a="30482107" Received: from mail-fx0-f217.google.com ([209.85.220.217]) by mail2-smtp-roc.national.inria.fr with ESMTP; 28 Jul 2009 14:05:49 +0200 Received: by fxm17 with SMTP id 17so2788103fxm.27 for ; Tue, 28 Jul 2009 05:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=B9rd76KDXc0WCIwzdBVFDxIz7RcBGgqID6uJhe9g6u4=; b=lrSn8DATjXiSq+TIEdlaAnz6IdVuXDI6KaxLrq3sZwNuOQ+yaegclgeRosk01o2hev Q3DRCKOk0Ae06mOVGroZSrHz5gm+uiASz8/vjJtEnKIFlstBeCuRhC0+Eoa1hZzpfntR hAXrRi/sF4v4IhVVniHGo0qiEYYnTFJA81hA8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=j1HWNPo0NpfMIRFTAHcsrwLRioYEimBU9MM7qDih5frAYwk74esSrs2APpd6Xb6YZs xfY3F6PNMgpwf3+jUvfioqZbyGnKOVFj6t+1JoMyB8C42XxUNm+dp3U9jDHn0RQ6lNv9 SgkudgwUv8QQzq7872Rr0mMPSVMZ30YT1Eqwo= MIME-Version: 1.0 Received: by 10.103.160.3 with SMTP id m3mr3945458muo.25.1248782748931; Tue, 28 Jul 2009 05:05:48 -0700 (PDT) In-Reply-To: <721f7f5a0907280438o479785efr3793f4d1dff5c1f4@mail.gmail.com> References: <721f7f5a0907280438o479785efr3793f4d1dff5c1f4@mail.gmail.com> Date: Tue, 28 Jul 2009 14:05:48 +0200 Message-ID: <721f7f5a0907280505y50d30aaax64a53dd4e010ea11@mail.gmail.com> Subject: Re: Camlp4 quotations for tuples From: Philippe Veber To: caml-list@yquem.inria.fr Content-Type: multipart/alternative; boundary=0016e659f8c826dbf3046fc2e40c X-Spam: no; 0.00; camlp:01 ctyp:01 camlp:01 ctyp:01 2009:98 2009:98 tuples:01 accu:02 accu:02 tuple:02 tuple:02 ast:02 ast:02 quotations:03 types:05 --0016e659f8c826dbf3046fc2e40c Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Self-answer, though I'm not sure that's the prettiest way (not even sure it is even valid) : <:ctyp< ($Ast.tySta_of_list tuple_types$) >> ph. 2009/7/28 Philippe Veber > Hi list, > > Does someone know how to write a camlp4 quotation for types of the form 'a > * 'b * 'c * 'd ... For now I could only obtain types of the form 'a * ('b * > ('c * ('d * ... )...))), using a code similar to > > > List.fold_right > (fun x accu -> <:ctyp< $x$ * $accu$ >>) > (List.tl tuple_types) > (List.hd tuple_types) > > > TIA, > ph. > > --0016e659f8c826dbf3046fc2e40c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Self-answer, though I'm not sure that's the prettiest way (not even= sure it is even valid) :

<:ctyp< ($Ast.tySta_of_list tuple_ty= pes$) >>

ph.


2009/7/28 P= hilippe Veber <philippe.veber@googlemail.com>
Hi list,

D= oes someone know how to write a camlp4 quotation for types of the form '= ;a * 'b * 'c * 'd ...=A0 For now I could only obtain types of t= he form 'a * ('b * ('c * ('d * ... )...))), using a code si= milar to


=A0List.fold_ri= ght
=A0=A0 (fun x accu -> <:ctyp< $x$ * $accu$ &g= t;>)
=A0=A0 (List.tl tuple_t= ypes)
=A0=A0 (List.hd tuple_types)


TIA,
ph.


--0016e659f8c826dbf3046fc2e40c--