From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 81A0ABC57 for ; Wed, 17 Mar 2010 19:37:35 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq4BAD29oEtDww+LkWdsb2JhbACDC4t0gXZ8iSwBAQEBCQsKBxMDH6pSN4FjhSiIeQEEBAGBJ4JgagSDGg X-IronPort-AV: E=Sophos;i="4.51,260,1267398000"; d="scan'208";a="47342264" Received: from web111502.mail.gq1.yahoo.com ([67.195.15.139]) by mail2-smtp-roc.national.inria.fr with SMTP; 17 Mar 2010 19:37:34 +0100 Received: (qmail 98413 invoked by uid 60001); 17 Mar 2010 18:37:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1268851052; bh=2qJkw53BSi7Cr0xRFPJIgKYsRA0ARkYHY70TCm3HED8=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=qrEQHkfwXUOjUy51wn17sBJ/h7FmDg4Ok98mNogOu+USjIADjO1VzyGlI37BxobYWmKZpVYwMMhKgdzUX9XllY28pEIq+/NhljZyhdhbHyKvPvmxUiofP0jm+e25+IN3kHyeo2Xh7/Aw/ch6ixfK+AL0Pu2CxvBVkmjKSyVjHXQ= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=0a2s9/8lkLTIXa0PIOA3xgq5e15d/WgT3SSgbi68UboX+YSHyN8Rm1770vLdZo3hEFUdBHd2Hpvp7SA+VyhY71vxKAK/0hBs476G/I0Ex6KBJCBphDqGIdM18iiR/Q2PdP0fck5m3CL9UmdMVDO7LDxik1HIgNcn7tvknI7iZKg=; Message-ID: <864095.98227.qm@web111502.mail.gq1.yahoo.com> X-YMail-OSG: iopoG_wVM1l5mlrSWrrKfgdmMUAM_1lWn.oKcoxHKkBl6vO gbGAVCQXGLPDz4o4.uh0xodQHi7bynPVxzxKZNatl9l2asJAq8BQcJOhkbcI m.5MOXsKg8qLNna5OacJIHMbV2hnkytnkdJ3Y86QrqzryEHTJSFHYRDT3nxw Xht3UrF2kyTuTDSdErIbtzG3q5A9PPir612itxBa1umDCsa8UZXCfynH6OZA o4VTzksn9ppe_Dk2f3V23BZdi1nb_6uBGGCgitAefdtouXZR0H2MI6ejXYqw WzPdKIyfPFlIxKzptBWNi1cf_UZdoCRoYzHDFNZuWBy1BGvlRZJhXl6I- Received: from [213.205.71.53] by web111502.mail.gq1.yahoo.com via HTTP; Wed, 17 Mar 2010 11:37:32 PDT X-Mailer: YahooMailClassic/10.0.8 YahooMailWebService/0.8.100.260964 Date: Wed, 17 Mar 2010 11:37:32 -0700 (PDT) From: Dario Teixeira Subject: RE: [Caml-list] Lazy modules To: caml-list@yquem.inria.fr, David Allsopp In-Reply-To: <00d801cac5f9$474281f0$d5c785d0$@romulus.metastack.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; afaik:01 syntax:01 compiler:01 syntax:01 renames:01 functor:01 ocaml:01 runtime:01 functors:01 functor:01 runtime:01 foo:01 sig:01 struct:01 endline:01 Hi,=0A=0A> AFAIK local modules is a syntax extension not a compiler=0A> ext= ension - I expect (not looked at it) that the syntax=0A> extension simply a= lpha renames all the local module=0A> declarations to make them unique and = puts them globally... a=0A> very useful extension but no expressive power a= dded.=0A=0ABut if that were true, wouldn't the functor instantiation happen= at=0Ainitialisation time, thus preventing the delayed instantiation that= =0Ais key for this solution to work?=0A=0A=0A> I believe that the module sy= stem due for OCaml 3.12.0 will=0A> allow this kind of runtime application o= f functors as=0A> modules are first class values.=0A=0AAgain, I'm under the= impression that functor application can already=0A(with 3.11 at least) occ= ur at runtime when local modules are used.=0A(Or are you talking about diff= erent things?). For example:=0A=0A# module Foo (S: sig end) =3D struct let= () =3D print_endline "foo!" end;;=0Amodule Foo : functor (S : sig end) ->= sig end=0A=0A# let hello () =3D let module F =3D Foo (struct end) in ();;= =0Aval hello : unit -> unit =3D =0A=0A# hello ();;=0Afoo!=0A- : unit = =3D ()=0A=0A=0A> Hope that's helpful - the inability to do what you're=0A> = wanting to do is one of the reasons that I've never delved=0A> deeply into = the module system - powerful as it may be, it=0A> didn't seem to be able to= help performing a simple task=0A> (similar to yours) that I wanted it to d= o (I have also in=0A> the past wanted to exactly what you're doing - i.e. a= module=0A> of loaded configuration values).=0A=0AYep, Alain confirmed that= modules as first-class values are indeed=0Acoming for 3.12. Ocaml's modul= e system just got more interesting...=0A=0ACheers,=0ADario Teixeira=0A=0A= =0A=0A