From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 75CFFBC8E for ; Fri, 18 Feb 2005 17:20:36 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j1IGKatO015974 for ; Fri, 18 Feb 2005 17:20:36 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA11794 for ; Fri, 18 Feb 2005 17:20:35 +0100 (MET) Received: from tcs.inf.tu-dresden.de (orchid.inf.tu-dresden.de [141.76.75.101]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1IGKZSr026580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 18 Feb 2005 17:20:35 +0100 Received: from ithif59.inf.tu-dresden.de (ithif59 [141.76.75.59]) by tcs.inf.tu-dresden.de (8.12.9/8.12.9) with ESMTP id j1IGKY86000768 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 18 Feb 2005 17:20:34 +0100 (MET) Received: from tews by ithif59.inf.tu-dresden.de with local (Exim 4.34) id 1D2Arq-0001n8-Bf for caml-list@inria.fr; Fri, 18 Feb 2005 17:20:34 +0100 To: Ocaml Subject: Camlp4 with traditional syntax (was: Camlp4 documentation) References: <4215A18C.7040603@barettadeit.com> <4215AD36.1070303@cs.unisa.edu.au> From: Hendrik Tews Date: 18 Feb 2005 17:20:34 +0100 In-Reply-To: <4215AD36.1070303@cs.unisa.edu.au> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) at tcs.inf.tu-dresden.de X-Miltered: at concorde with ID 421615D4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 421615D3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; syntax:01 hendrik:01 tews:01 tews:01 syntax:01 ocaml:01 expander:01 ocaml:01 rauglaudre:01 parsing:01 expander:01 mlast:01 mlast:01 hendrik:01 writes:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Alex Cowie writes: For me, the use of revised syntax has been a disincentive to using Camlp4 metaprogramming. I have always wondered whether a traditional syntax version of Camlp4 was technically feasible. Any comments? I believe it is possible. You can parse traditional ocaml (as opposed to the revised syntax) with camlp4, so it should be possible to write a quotation expander using traditional ocaml. I remember Daniel de Rauglaudre complaint a few times about the difficulty of parsing ocaml. So a quotation expander using traditional ocaml might have dark corners which do not look as elegant as pa_macro.ml. A alternative quotation expander using traditional ocaml would be much simpler to set up than the original one in camlp4/meta/q_MLast, because you don't have to deal with bootstrapping issues. The alternative expander would be written in the revised syntax and compiled when camlp4 has been built. Moreover, all the necessary pieces are already contained in the camlp4 sources: the quotation expander is in q_MLast and the traditional ocaml syntax is in etc/pa_o.ml. So you would only mix the two files, taking the grammer from pa_o and the actions from q_MLast. I even started once, but did not continue. If anybody starts to work on an alternative quotation expander using traditional ocaml, please announce. Bye, Hendrik Tews