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=0.3 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id B0734BBC1 for ; Fri, 14 Mar 2008 16:33:10 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuQAAMg32kfOvjGuoWdsb2JhbACDJY1bAQEBAQEBBQQGCQgBF5gq X-IronPort-AV: E=Sophos;i="4.25,501,1199660400"; d="scan'208";a="10276078" Received: from web54604.mail.re2.yahoo.com ([206.190.49.174]) by mail3-smtp-sop.national.inria.fr with SMTP; 14 Mar 2008 16:33:10 +0100 Received: (qmail 79458 invoked by uid 60001); 14 Mar 2008 15:33:09 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=GnJT9GqIFaezAO2Zn8Ucp3/EkTvQollK22KZWd/ovt7cXoiFyMUl31QIb85tdxucMy3bCiIi/m2ugw1mu+eI8SEcGNngWJxUNSex/f7DDOAdmh/KoEb0Ch0bbwPd4oNS87tu93Cb/Hixic/NJc5GJ5XhOh2B7Lkj3TRve2i3Fz8=; X-YMail-OSG: sZB.ZaoVM1kJqyXjsf3qTCKk4z_uZabY844fW1npthYlCE21ypVJ0TVxxAwuZuhX18WtF9TcEutypZmUKQN14CuR.4p.dTKoYSJbecBAgkgWyHTgymnQlZbndWvtBoC3EkPgGURK8x1ylL957kYOGfd7mA-- Received: from [82.155.118.40] by web54604.mail.re2.yahoo.com via HTTP; Fri, 14 Mar 2008 15:33:08 GMT Date: Fri, 14 Mar 2008 15:33:08 +0000 (GMT) From: Dario Teixeira Subject: Re: [Caml-list] OSR: META files for packages containing syntax extensions To: blue storm , caml-list@yquem.inria.fr In-Reply-To: <527cf6bc0803131008y151941a3ka3b9e50721ba3229@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <983301.78248.qm@web54604.mail.re2.yahoo.com> X-Spam: no; 0.00; syntax:01 parser:01 syntax:01 camlp:01 parser:01 ocaml:01 ocaml:01 camlp:01 cmo:01 dependencies:01 patched:01 bigarray:01 byte:01 cmxa:01 sexp:01 Hi, > Some extensions use eg. both a parser and a filter; i guess they'd > need to chose the most meaningful prefix (are they primarily intended > to modify the existing syntax, or change a behavior ?). > There are some code that can be described as a "syntax extension", but > that does not use any of the camlp4 parser/printer/filter tools. The > 'extensions' using the library type-conv ( > http://www.ocaml.info/home/ocaml_sources.html#type-conv ), for > example, use a specific registration mechanism. I guess the p_ prefix > would be appropriate for those corner cases. Thanks for ellucidation. Alternatively, since the preprocessor is oblivious to the name of the package (as you say, even Camlp5 may only care about the name of the .cmo file), we can simply declare this to be a documentation problem and to not enforce any convention regarding the package name (except for the previously discussed .syntax suffix). Therefore, the package implementing the "openin" extension could be called "pa_openin", "openin", or whatever the author prefers due to historical reasons. The only requirement is that the syntax extension itself should reside in an "openin.syntax" subpackage. > Another common case is when the syntax extension rely on a > preprocessor-time module or library (eg. type-conv). It could be > helpful to add a description of that possibility. I think that is also a documentation issue. Ideally, the META files should be constructed in such a way that the user should not have to care about extension dependencies. As an example, consider the Sexplib syntax extension, which itself depends on the type-conv extension. On my system, I have patched the META files so that this is transparent to the Sexplib users. Here's my META file for Sexplib: -------------------------------------------------------- name="sexplib" version="3.0.0" description="Sexplib - automated S-expression conversions" requires="bigarray" archive(byte)="sexplib.cma" archive(native)="sexplib.cmxa" package "syntax" ( requires = "sexplib,type-conv.syntax,camlp4" version = "3.0.0" description = "Syntax extension for Sexplib" archive(syntax,preprocessor) = "pa_sexp_conv.cmo" archive(syntax,toploop) = "pa_sexp_conv.cmo" ) -------------------------------------------------------- And the META file for Type-conv: -------------------------------------------------------- name="type-conv" version="1.0.0" description="Type-conv - support library for preprocessor type conversions" package "syntax" ( requires = "camlp4" version = "1.0.0" description = "Syntax extension for type-conv" archive(syntax,preprocessor) = "pa_type_conv.cmo" archive(syntax,toploop) = "pa_type_conv.cmo" ) -------------------------------------------------------- > Is there a way to specify a dependency on a specific preprocessor > (between camlp4o and camlp4r, for example ?). Most extension actually > won't work with both syntaxes (classical and revised), and it could be > helpful to make it apparent in the package description (although most > of the time an horrible preprocessor-runtime error will happen). > More generally, i'm concerned with the possible incompatibilities > between syntax extensions (however, this may be a bit off-topic). I don't know if there's support for those cases (are there any in the wild?). Perhaps some of Findlib's gurus can enlighten us... Cheers, Dario ___________________________________________________________ Rise to the challenge for Sport Relief with Yahoo! For Good http://uk.promotions.yahoo.com/forgood/