From: David Teller <David.Teller@univ-orleans.fr>
To: David Allsopp <dra-news@metastack.com>
Cc: Caml <caml-list@yquem.inria.fr>
Subject: RE: [Caml-list] Invoking the standard library ?
Date: Tue, 29 Apr 2008 21:50:03 +0200 [thread overview]
Message-ID: <1209498604.7286.43.camel@Blefuscu> (raw)
In-Reply-To: <003a01c8aa2c$5962f6c0$017ca8c0@countertenor>
On Tue, 2008-04-29 at 20:07 +0100, David Allsopp wrote:
> I don't quite following the motivation for needing module Inria: there's no
> problem with writing:
>
> module String = struct
> include String
> (* Your functions here *)
> end
Doesn't work whenever the module is contained in its own file.
(*File string.ml*)
include String
let _ = print_endline "Done"
(*end of file string.ml*)
$ ocamlbuild string.cmo
Circular build detected
(string.cmi already seen in [ string.cmi; string.cmo ])
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
$ ocamldep string.ml
string.cmo: string.cmo
string.cmx: string.cmx
$ ocamlc string.ml
File "string.ml", line 1, characters 8-14:
Unbound module String
etc.
> but I think perhaps I've not understood the problem properly. That said, why
> is defining module Inria clumsy? I copied the table of contents from the
> StdLib page and with a couple of %s instructions got
>
> module Inria =
> struct
> module Arg = Arg
> module Array = Array
> (* 34 additional lines *)
> module StringLabels = StringLabels
> module Sys = Sys
> end
>
> Which is exactly what you want, right?
Auto-generating the module is not hard. It's getting everything to
compile without having to hand-write a Makefile (e.g. with ocamlbuild).
Indeed, module Inria depends on [the original] String, [the original]
Sys, etc... and I wouldn't want ocamlbuild or ocamldep to decide
compiling string.ml before inria.ml.
Cheers,
David
--
David Teller
Security of Distributed Systems
http://www.univ-orleans.fr/lifo/Members/David.Teller
Angry researcher: French Universities need reforms, but the LRU act
brings liquidations.
next prev parent reply other threads:[~2008-04-29 19:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-29 14:26 David Teller
2008-04-29 18:19 ` [Caml-list] " Eric Cooper
2008-04-30 0:05 ` Jacques Garrigue
2008-04-30 7:51 ` Christophe Raffalli
2008-04-30 13:38 ` Eric Cooper
2008-05-01 1:59 ` Gordon Henriksen
2008-04-30 11:35 ` David Teller
[not found] ` <003a01c8aa2c$5962f6c0$017ca8c0@countertenor>
2008-04-29 19:50 ` David Teller [this message]
2008-04-29 22:58 ` Ashish Agarwal
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=1209498604.7286.43.camel@Blefuscu \
--to=david.teller@univ-orleans.fr \
--cc=caml-list@yquem.inria.fr \
--cc=dra-news@metastack.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