Browse thread
Nesting Modules
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2005-11-02 (11:08) |
From: | Richard Jones <rich@a...> |
Subject: | Re: [Caml-list] Nesting Modules |
On Wed, Nov 02, 2005 at 11:57:45AM +0100, Daniel Bünzli wrote: > Le 2 nov. 05 ŕ 11:47, Richard Jones a écrit : > > consider a database layer: > > > > Database > > Database_Postgres > > Database_MySQL > > > >Obviously '_' is the way to go here if you want multiple third parties > >to provide database modules. 'include' wouldn't work at all here. > > You are right. I think 'include' doesn't work here because there is a > notion of choice. If I understand well your example, functors > wouldn't help here because it is not that you want to get a unified > interface (frontend) from a specific database implementation > (backend), but you really want to access database specific features > via the third party modules, right ? Yes; I'm really comparing it to Perl's modules. In Perl's module repository, CPAN, they have a zillion modules and so need to name them sensibly and hierarchically. For example under "Net"[1] you have "Net::DHCP", "Net::Daemon", "Net::FTP", etc... There is no way to "open Net" (or its equivalent) in Perl - this is just a useful way to organise modules. May not be applicable to OCaml of course. Rich. [1] http://www.cpan.org/modules/by-module/Net/ -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com