caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Stefano Zacchiroli <zack@upsilon.cc>
To: OCaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Replacing Pervasives?
Date: Mon, 8 Sep 2008 22:40:23 +0200	[thread overview]
Message-ID: <20080908204023.GA27166@usha.takhisis.invalid> (raw)
In-Reply-To: <1220895304.11009.38.camel@Blefuscu>

On Mon, Sep 08, 2008 at 07:35:04PM +0200, David Teller wrote:
> On Mon, 2008-09-08 at 17:06 +0200, Romain Bardou wrote:
> > In other word it's as if you changed your "official" 
> > stdlib/Pervasives.cmo except that it's cleanier as you don't actually 
> > override it (which would change your Pervasives for all your projects).
> Technically, it fails because you have to name your new module
> Pervasives and thus cause a conflict with the original Pervasives.

Why you need to have the legacy Pervasives around? You can remove it
and/or include what you need of it in your customized Pervasives, can't
you? That wouldn't violate your requirement of messing around with
ocamlc code, you would only do that with the standard library source
files.

> > Basically, just use any hack which can replace your ocamlc by a script 
> > which adds "open Myperv;;\n" before calling ocamlc ^^
> Unfortunately, it seems that ocamlc only supports one "-pp" tag. So if I
> use a simple "-pp 'cat myprefix.ml'", I become incompatible with
> Camlp4 :/

You can use a shell script (or a real program) of your which first
invokes camlp4 as a filter and first feeds into it myprefix.ml and after
that the real file. More generally your custom program can combine
together a pipeline of any number of preprocessors.

Cheers.

-- 
Stefano Zacchiroli -*- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
I'm still an SGML person,this newfangled /\ All one has to do is hit the
XML stuff is so ... simplistic  -- Manoj \/ right keys at the right time


  reply	other threads:[~2008-09-08 20:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08  8:06 David Teller
2008-09-08  9:17 ` [Caml-list] " David Teller
2008-09-08 10:04   ` Romain Bardou
2008-09-08 10:51     ` David Teller
2008-09-08 15:06       ` Romain Bardou
2008-09-08 17:35         ` David Teller
2008-09-08 20:40           ` Stefano Zacchiroli [this message]
2008-09-08 21:03 ` Richard Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080908204023.GA27166@usha.takhisis.invalid \
    --to=zack@upsilon.cc \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).