From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,RCVD_IN_BL_SPAMCOP_NET autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 7039CBB84 for ; Thu, 29 Jan 2009 11:41:14 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4BAMcWgUlRZ90wlGdsb2JhbACNcIYiAQEBAQkLCAkRA7c3hA4G X-IronPort-AV: E=Sophos;i="4.37,343,1231110000"; d="scan'208";a="20337237" Received: from mtaout02-winn.ispmail.ntl.com ([81.103.221.48]) by mail2-smtp-roc.national.inria.fr with ESMTP; 29 Jan 2009 11:41:14 +0100 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090129104113.NGEH4080.mtaout02-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Thu, 29 Jan 2009 10:41:13 +0000 Received: from romulus.metastack.com ([81.102.132.77]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090129104113.JTXV19264.aamtaout01-winn.ispmail.ntl.com@romulus.metastack.com>; Thu, 29 Jan 2009 10:41:13 +0000 Received: from Countertenor (genkt-048-018.t-mobile.co.uk.254.149.in-addr.arpa [149.254.48.18] (may be forged)) (authenticated bits=0) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id n0TAerAL020909 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 29 Jan 2009 10:41:03 GMT From: "David Allsopp" To: "'nicolas.pouillard'" , "'David.Teller'" Cc: "'Jacques Carette'" , "'caml-list'" , "'Andrej Bauer'" References: <497DD1F5.7050702@yahoo.fr> <497DD398.5030501@mcmaster.ca> <7d8707de0901270630mf12c557oc0554a4276b62463@mail.gmail.com> <497F1E8D.2080000@mcmaster.ca> <1233090779.6463.10.camel@Blefuscu> <1233102370-sup-9649@ausone.local> <1233141926.6908.4.camel@Blefuscu> <1233221605-sup-9234@ausone.local> In-Reply-To: <1233221605-sup-9234@ausone.local> Subject: RE: [Caml-list] Defining a family of functors Date: Thu, 29 Jan 2009 10:40:50 -0000 Organization: MetaStack Solutions Ltd. Message-ID: <00ed01c981fe$167d0c60$43772520$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcmB9WSCVdFArlryTr+8cWXR65LqfAAByd+g Content-Language: en-gb X-Scanned-By: MIMEDefang 2.64 on 81.102.132.74 X-Cloudmark-Analysis: v=1.0 c=1 a=pNdLnMu5tYMA:10 a=HKAh5yqB0fsA:10 a=QAVJZRpuYrahEiNd3C8A:9 a=F96pAaFehlVXVmGw_hIA:7 a=WAgnA7d21J3cqHjqU6-gAAJzfYAA:4 a=MxZ3bB5I4kYA:10 X-Spam: no; 0.00; functors:01 compiler:01 ocaml:01 recompile:01 ocaml:01 mssql:98 config:01 config:01 wrote:01 caml-list:01 functions:01 functions:01 alain:01 modules:02 modules:02 > > On the other hand, it was pointed to me that Alain already wrote a > > compiler patch implementing first-class modules. >=20 > That's right. I have two questions - the first of which will probably demonstrate my = lack of skill with the OCaml module system. 1. Does first-class modules, as with first-class functions mean that you = can pass them around in code? For example, I have a web-app where all of = the stuff which has to access databases is put into a single module with = a known signature DB. I then have two modules MSSQLDriver and = PGSQLDriver which implement the database functions for two different = back-ends and have in DB.ml module DB =3D MSSQLDriver include DB So when I build for Postgres, I just change the module statement and = recompile. Would first class modules allow me to read the back-end = configuration from a config file and write something like: module DB =3D if Config.driver =3D `MSSQL then MSSQLDriver else = PGSQLDriver Or is it about something totally different? :o) 2. Is this patch intended for a future version of OCaml or just for = research purposes? David