Version française
Home     About     Download     Resources     Contact us    
Browse thread
Modules vs Modular programming
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Eric Cooper <ecc@c...>
Subject: Re: [Caml-list] Modules vs Modular programming
On Fri, Feb 23, 2007 at 09:16:11PM +0100, Julien Peeters wrote:
> I'am currently working on a academic project in OCaml. I have to do the
> choice of multiple files vs multiple ocaml modules per file.
> 
> I would like to know your point of view about this choice I have to do.
> For instance, what did you choose if you've already done this choice and
> why?

I would use one module per file for all but trivial modules, to take
advantage of the OCaml compiler's support for that model (pairing of
.mli with .ml files), and better support by software development tools
like make and subversion, etc., which operate at file granularity.

An example of trivial modules where this doesn't apply would be those
built for the purposes of functor application -- they often have
components that just rename values defined elsewhere.

-- 
Eric Cooper             e c c @ c m u . e d u