caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] first class modules: differences in 3.12 vs 3.13?
@ 2011-03-30  7:57 Joel Reymont
  2011-03-30  8:02 ` Dmitry Bely
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Reymont @ 2011-03-30  7:57 UTC (permalink / raw)
  To: caml-list

I get an error on this with 3.12 but no error with 3.13.0+dev2 (2010-10-22).

let _ = Simple.main (module Client) (module Server) (module Config)

Why? I thought 3.12 supported first-class modules.

	Thanks, Joel

--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] first class modules: differences in 3.12 vs 3.13?
  2011-03-30  7:57 [Caml-list] first class modules: differences in 3.12 vs 3.13? Joel Reymont
@ 2011-03-30  8:02 ` Dmitry Bely
  2011-03-30  8:27   ` Maxence Guesdon
  2011-03-30  8:59   ` Anders Fugmann
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitry Bely @ 2011-03-30  8:02 UTC (permalink / raw)
  To: caml-list

On Wed, Mar 30, 2011 at 11:57 AM, Joel Reymont <joelr1@gmail.com> wrote:
> I get an error on this with 3.12 but no error with 3.13.0+dev2 (2010-10-22).
>
> let _ = Simple.main (module Client) (module Server) (module Config)
>
> Why? I thought 3.12 supported first-class modules.

I believe module types are a must:

let _ = Simple.main (module Client : CLIENT) (module Server : SERVER)
(module Config : CONFIG)

- Dmitry Bely

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] first class modules: differences in 3.12 vs 3.13?
  2011-03-30  8:02 ` Dmitry Bely
@ 2011-03-30  8:27   ` Maxence Guesdon
  2011-03-30  8:59   ` Anders Fugmann
  1 sibling, 0 replies; 5+ messages in thread
From: Maxence Guesdon @ 2011-03-30  8:27 UTC (permalink / raw)
  To: caml-list

On Wed, 30 Mar 2011 12:02:53 +0400
Dmitry Bely <dmitry.bely@gmail.com> wrote:

> On Wed, Mar 30, 2011 at 11:57 AM, Joel Reymont <joelr1@gmail.com> wrote:
> > I get an error on this with 3.12 but no error with 3.13.0+dev2 (2010-10-22).
> >
> > let _ = Simple.main (module Client) (module Server) (module Config)
> >
> > Why? I thought 3.12 supported first-class modules.
> 
> I believe module types are a must:
> 
> let _ = Simple.main (module Client : CLIENT) (module Server : SERVER)
> (module Config : CONFIG)

In revision 10738, the implicit-unpack branch was merged to the trunk. I
think this allows
  let _ = Simple.main (module Client) (module Server) (module Config)
instead of
  let _ = Simple.main (module Client : CLIENT) (module Server : SERVER)
    (module Config : CONFIG)

and that it explains the difference.


-- 
Maxence Guesdon                             http://yquem.inria.fr/~guesdon/
Service Expérimentation et Développements         https://sed-roc.inria.fr/
INRIA Paris-Rocquencourt                  http://www.inria.fr/rocquencourt/





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] first class modules: differences in 3.12 vs 3.13?
  2011-03-30  8:02 ` Dmitry Bely
  2011-03-30  8:27   ` Maxence Guesdon
@ 2011-03-30  8:59   ` Anders Fugmann
  2011-03-30  9:18     ` Dmitry Bely
  1 sibling, 1 reply; 5+ messages in thread
From: Anders Fugmann @ 2011-03-30  8:59 UTC (permalink / raw)
  To: Dmitry Bely; +Cc: caml-list

Hi Dmitry,

On 03/30/2011 10:02 AM, Dmitry Bely wrote:
> On Wed, Mar 30, 2011 at 11:57 AM, Joel Reymont<joelr1@gmail.com>  wrote:
>> I get an error on this with 3.12 but no error with 3.13.0+dev2 (2010-10-22).
>>
>> let _ = Simple.main (module Client) (module Server) (module Config)
>>
>> Why? I thought 3.12 supported first-class modules.
>
> I believe module types are a must:
>
> let _ = Simple.main (module Client : CLIENT) (module Server : SERVER)
> (module Config : CONFIG)

I tried this using 3.12, and the compiler now complains that:
Error: Unbound module type CLIENT

(I'm using the same code base as Joel Reymont)

If the names in capital letters just arbitrary names?

btw. ocamldep accepted the code above just fine.

>
> - Dmitry Bely
>

Regards
Anders Fugmann



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] first class modules: differences in 3.12 vs 3.13?
  2011-03-30  8:59   ` Anders Fugmann
@ 2011-03-30  9:18     ` Dmitry Bely
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Bely @ 2011-03-30  9:18 UTC (permalink / raw)
  To: Anders Fugmann; +Cc: caml-list

On Wed, Mar 30, 2011 at 12:59 PM, Anders Fugmann <anders@fugmann.net> wrote:
> Hi Dmitry,
>
> On 03/30/2011 10:02 AM, Dmitry Bely wrote:
>>
>> On Wed, Mar 30, 2011 at 11:57 AM, Joel Reymont<joelr1@gmail.com>  wrote:
>>>
>>> I get an error on this with 3.12 but no error with 3.13.0+dev2
>>> (2010-10-22).
>>>
>>> let _ = Simple.main (module Client) (module Server) (module Config)
>>>
>>> Why? I thought 3.12 supported first-class modules.
>>
>> I believe module types are a must:
>>
>> let _ = Simple.main (module Client : CLIENT) (module Server : SERVER)
>> (module Config : CONFIG)
>
> I tried this using 3.12, and the compiler now complains that:
> Error: Unbound module type CLIENT
>
> (I'm using the same code base as Joel Reymont)
>
> If the names in capital letters just arbitrary names?

Of course, you should define it first:

module type CLIENT =
sig
...
end

In your case

module type CLIENT =
sig
  include module type of Client
end

will probably be sufficient. For more information on module types see
chapter 6.10 of the OCaml user's manual.

- Dmitry Bely


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-30  9:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-30  7:57 [Caml-list] first class modules: differences in 3.12 vs 3.13? Joel Reymont
2011-03-30  8:02 ` Dmitry Bely
2011-03-30  8:27   ` Maxence Guesdon
2011-03-30  8:59   ` Anders Fugmann
2011-03-30  9:18     ` Dmitry Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).