caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Romain Bardou <Romain.Bardou@lri.fr>
To: OCaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Replacing Pervasives?
Date: Mon, 08 Sep 2008 17:06:39 +0200	[thread overview]
Message-ID: <48C53F7F.4090805@lri.fr> (raw)
In-Reply-To: <1220871079.11009.18.camel@Blefuscu>

David Teller a écrit :
> Would that open anything by default?
> 
> 
> On Mon, 2008-09-08 at 12:04 +0200, Romain Bardou wrote:
>> I guess you could try and make your own stdlib directory, and then
>> call 
>> ocamlc using:
>>
>> ocamlc -nostdlib -I mystdlib
>>
>> or something like that...
>>

My guess is that it would try to open mystdlib/Pervasives.cmo...

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).

I didn't try it though, so maybe I'm missing something.

Another way to automatically open your module would be to do a weird 
Makefile such as:

%.cmo: %.ml
     echo "open Myperv;;\n" > $*.temp.ml
     cat $*.ml >> $*.temp.ml
     ocamlc -c $*.temp.ml -o $*.cmo
     rm $*.temp.ml

Or you could do this using some Ocamlbuild plug-in, or just by using the 
-ocamlc option of Ocamlbuild...

Basically, just use any hack which can replace your ocamlc by a script 
which adds "open Myperv;;\n" before calling ocamlc ^^

-- 
Romain Bardou


  reply	other threads:[~2008-09-08 15:06 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 [this message]
2008-09-08 17:35         ` David Teller
2008-09-08 20:40           ` Stefano Zacchiroli
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=48C53F7F.4090805@lri.fr \
    --to=romain.bardou@lri.fr \
    --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).