caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Patrick M Doane <patrick@watson.org>
To: Chris Hecker <checker@d6.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ocamlmktop and includes
Date: Sun, 29 Apr 2001 12:44:34 -0400 (EDT)	[thread overview]
Message-ID: <Pine.BSF.3.96.1010429123152.15918A-100000@fledge.watson.org> (raw)
In-Reply-To: <4.3.2.7.2.20010428224507.02ebccf0@shell16.ba.best.com>

On Sat, 28 Apr 2001, Chris Hecker wrote:

> 
> >My initial expectation was that building a top-level interpreter would
> >link the object files into that interpeter.  That maybe an alternative
> >approach to addressing this issue.
> 
> Yes, but you want both.  You link the .cmos (or .cmas) in, but you also
> need a path to their .cmi files, which is what the include dirs are for. 
> It might be nice if there was some way to also have the .cmi files
> onboard with the toplevel (or in libraries), so it was just all there
> with no need for other stuff.  I'm not going to implement that, though. 
> ;) 

I thought initially the include path was for the .cmo, but I see it is for
the .cmi files now.  I agree that having a mechanism to include the .cmi
files would work out very well.

My goal is to provide a application which can execute Caml source files. 
The source files should have access to some of the modules which are part
of the application. I'm not particularly interested in the interactive
aspect, but I want to make sure that the Caml source files do not need to
be compiled to byte-code before being exeucted.  My top-level application
should have its own command-line options and usage messages which are
separate from those provided by Topmain. 

My current approach to this goes through several layers of indirection:

1) Write my program with code to execute script files similarly to the
approach used in Topmain. 

2) Write a one line Caml script which calls the entry point to my program

3) Build a top-level interpreter using ocamlmktop for my program. 

4) Write a shell-script which calls the top-level interpreter with the
include directories for the .cmi files that I want the scripts to be able
to access and execute the one line Caml script.  All arugments passed to
the shell script are then forwarded to the entry point. 

I think I could remove some of these steps if it were possible to access
the Clflags.include_dirs variable.  The top-level code to execute a script
will only look for .cmi files in that directory. So to get around this, I
source a script in the traditional mechanism which can then source more
scripts.

Any thoughts on a better approach?

Patrick Doane

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


  reply	other threads:[~2001-04-29 16:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.BSF.3.96.1010428104723.97098B-100000@fledge.watson.or g>
2001-04-28 21:50 ` Chris Hecker
2001-04-28 22:26   ` Patrick M Doane
2001-04-29  5:46     ` Chris Hecker
2001-04-29 16:44       ` Patrick M Doane [this message]
2001-05-01  1:27 David Gurr
2001-05-01  2:57 ` Patrick M Doane
  -- strict thread matches above, loose matches on Subject: below --
2001-04-28 14:54 Patrick M Doane
2001-05-01  1:05 ` Jacques Garrigue
2001-05-01  3:39   ` John Gerard Malecki

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=Pine.BSF.3.96.1010429123152.15918A-100000@fledge.watson.org \
    --to=patrick@watson.org \
    --cc=caml-list@inria.fr \
    --cc=checker@d6.com \
    /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).