English version
Accueil     Ŕ propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis ŕ jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml ŕ l'adresse ocaml.org.

Browse thread
OSR - "Batteries included" - Standardizing syntax extensions and extra libraries
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-03-04 (20:31)
From: Dario Teixeira <darioteixeira@y...>
Subject: Re: [Caml-list] OSR - "Batteries included" - Standardizing syntax extensions and extra libraries
> If ocamlfind were included as a standard part of the community OCaml
> distribution, then I think it would ease this process significantly.


Indeed.  I was about to start my own OSR thread concerning the proper
use of ocamlfind with libraries that offer a syntax extension.  One
good example is PG'OCaml (by Rich Jones): it ships with a META file
that makes the use of the syntax extension really simple with findlib.
This is the META file: (I just removed the description lines)


package "statements" (
  requires = "pgocaml,camlp4"
  version = "1.0"
  archive(syntax,preprocessor) = "pa_pgsql.cmo"
  archive(syntax,toploop) = "pa_pgsql.cmo"

Notice the "statements" subpackage.  Suppose you have a "test.ml" file
that uses PG'OCaml's syntax extension.  Compiling it with findlib is
as simple as:

ocamlfind ocamlc -package pgocaml.statements -syntax camlp4o -c test.ml

This is of course particularly relevant for GODI, and I noticed that not
all GODI packages ship with camlp4-friendly META files (Sexplib, for one).
Moreover, it would be nice if a standard name could be found for these
subpackages.  PG'OCaml uses "statements", but that may be a bit long-winded.
What about just "pp"?

Now, to reach package nirvana, we just need to get Ocamlbuild to be
friendlier to findlib -- including in the use of these syntax extensions.

Dario Teixeira

Sent from Yahoo! Mail.
A Smarter Inbox. http://uk.docs.yahoo.com/nowyoucan.html