From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q1L50Q0c025431 for ; Tue, 21 Feb 2012 06:00:28 +0100 X-IronPort-AV: E=Sophos;i="4.73,455,1325458800"; d="scan'208";a="145194220" Received: from yquem.inria.fr ([128.93.8.37]) by mail1-relais-roc.national.inria.fr with ESMTP; 21 Feb 2012 06:00:28 +0100 Received: by yquem.inria.fr (Postfix, from userid 25991) id A4DA6E191B; Tue, 21 Feb 2012 06:00:28 +0100 (CET) Date: Tue, 21 Feb 2012 06:00:28 +0100 From: Daniel de Rauglaudre To: Caml List Message-ID: <20120221050028.GA12493@yquem.inria.fr> References: <1622771061.955142.1329782170309.JavaMail.root@zmbs3.inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1622771061.955142.1329782170309.JavaMail.root@zmbs3.inria.fr> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [Caml-list] camlp5 pa_pragma Hi, On Tue, Feb 21, 2012 at 12:56:10AM +0100, bob zhang wrote: > I noticed that camlp5 has a pretty nice extension pa_pragma, would > you like shed some light on this? It allows to execute code at syntactic analysis phase and, therefore, to do syntactic extensions without having to previously compile a file, containing these extensions. I am not very satisfied of it, because the evaluation supposes to type expressions, or to try to type them, what, normally, Camlp* are not supposed to do. It is complicated, incomplete and perhaps dangerous. To be correct, it should embark the OCaml toplevel and, therefore, the whole OCaml compiler, what is not a good idea. I tried to limit it to evaluation of syntax extensions but it remains complicated. Probably we should define a precise sub-language for it. > (I mean the design issue, and the its defect) I would be happy to > port it to camlp4 if it's not too difficult I am afraid it is. -- Daniel de Rauglaudre http://pauillac.inria.fr/~ddr/