From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 4DDCBBC57 for ; Mon, 30 Aug 2010 16:18:55 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApUEACpbe0yNTDBjgWdsb2JhbACTKY0cFQEBFiIiuwiFNwSKCQ X-IronPort-AV: E=Sophos;i="4.56,292,1280700000"; d="scan'208";a="68372763" Received: from os.inf.tu-dresden.de ([141.76.48.99]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Aug 2010 16:18:55 +0200 Received: from [2002:8d4c:3001:48:222:68ff:fe19:71d] (helo=blau.inf.tu-dresden.de) by os.inf.tu-dresden.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) id 1Oq5CH-0003oy-V0 for caml-list@yquem.inria.fr; Mon, 30 Aug 2010 16:18:54 +0200 Received: from tews by blau.inf.tu-dresden.de with local (Exim 4.72) (envelope-from ) id 1Oq5CH-0001K4-9h for caml-list@yquem.inria.fr; Mon, 30 Aug 2010 16:18:53 +0200 From: Hendrik Tews To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Quotations and the functorial camlp4 interface References: <19548.32194.301525.322135@blau.inf.tu-dresden.de> Date: Mon, 30 Aug 2010 16:18:52 +0200 In-Reply-To: <19548.32194.301525.322135@blau.inf.tu-dresden.de> (Hendrik Tews's message of "Fri, 6 Aug 2010 23:25:22 +0200") Message-ID: <6x7hj86v5f.fsf@blau.inf.tu-dresden.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam: no; 0.00; hendrik:01 tews:01 tews:01 camlp:01 camlp:01 syntax:01 parses:01 syntax:01 parses:01 submodule:01 functor:01 syntaxes:01 submodule:01 struct:01 mutable:01 I wrote: More in detail: Assume I obtained two camlp4 syntax modules SO and SR, such that SO parses the orginal syntax and SR parses the revised syntax. I now want to add quotation support to both SO and SR. Following Camlp4OCamlRevisedQuotationExpander I do There is one point that I found out myself in the meantime: quotations are installed by mutating something inside the Quotation submodule of a Camlp4Syntax. Further, the functor that creates emoty syntaxes, OCamlInitSyntax, uses its Quotation argument literally as Quotation submodule in its output. Therefore, when creating the modules SO and SR it is important to do so with freshly generated quotations modules (by Camlp4.Struct.Quotation.Make). How about the Loc submodule of Ast that is passed into OCamlInitSyntax? There is the mutable Loc.name, which contains the default location variable. If I reuse the Ast argument of OCamlInitSyntax, will the mutable Loc.name be shared between the outputs? Are there syntax extensions in the camlp4 distribution that mutate Loc.name? Bye, Hendrik