From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 87078BC75 for ; Fri, 18 Feb 2005 19:43:39 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1IIhdkR015223 for ; Fri, 18 Feb 2005 19:43:39 +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 TAA18473 for ; Fri, 18 Feb 2005 19:43:38 +0100 (MET) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1IIhbIQ015220 for ; Fri, 18 Feb 2005 19:43:38 +0100 Received: from frontend2.messagingengine.com (frontend2.internal [10.202.2.151]) by frontend1.messagingengine.com (Postfix) with ESMTP id 23D3EC5954E; Fri, 18 Feb 2005 13:43:34 -0500 (EST) X-Sasl-enc: BQHZPjg+gn9lOxI+UbwSjw 1108752213 Received: from [172.16.112.115] (burnham.ljcrf.edu [192.231.106.2]) by frontend2.messagingengine.com (Postfix) with ESMTP id A48CD75E; Fri, 18 Feb 2005 13:43:32 -0500 (EST) Date: Fri, 18 Feb 2005 10:43:27 -0800 (PST) From: Martin Jambon X-X-Sender: martin@localhost To: Hendrik Tews Cc: Ocaml Subject: Re: [Caml-list] Camlp4 with traditional syntax (was: Camlp4 documentation) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 4216375B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42163759.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 syntax:01 hendrik:01 tews:01 wrote:01 syntax:01 ocaml:01 expander:01 ocaml:01 rauglaudre:01 parsing:01 expander:01 replacing:01 writes:01 century:98 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: On 18 Feb 2005, Hendrik Tews wrote: > 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. There is (at least) one construct which is not provided by the regular syntax (because it is totally useless when writing code by hand) but which is essential: declare end This just packs several definitions (str_items) as one single str_item. This is extremely useful when replacing one definition written in an extended syntax by several successive definitions (or zero) written in OCaml. Martin -- Martin Jambon, PhD Researcher in Structural Bioinformatics since the 20th Century The Burnham Institute http://www.burnham.org San Diego, California