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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Nesting Modules
On Tue, Nov 01, 2005 at 10:59:27AM -0600, Tom Hawkins wrote:
> Can I instruct the compiler to nest Bottom somewhere in Top, to obtain 
> clean, hierarchical names (eg: Top.Bottom.some_function)?  Of course I 
> can inline bottom.ml in top.ml, but then the file become rather large.

If you want clean, hierarchical names it's much better to use '_' to
separate the hierarchies (eg. Top_Bottom).  The reason for this is
that it allows others to extend your hierarchy by adding other modules
(eg. someone else can easily then create Top_MyExtension).

This means a bit of file renaming:

  top.mli
  top.ml
  top_Bottom.mli
  top_Button.ml

Rich.

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com