Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Announcing ocalibs.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-05-16 (01:04)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Announcing ocalibs.
On Sun, 2004-05-16 at 06:57, Jere Sanisalo wrote:
> On Sat, May 15, 2004 at 10:48:25PM +0200, Nicolas Cannasse wrote:
> >However one of the problem when writing games with ocaml is the lack of
> >mutual recursives modules,

I would expect recursion is no problem for games because games
tend to need dynamic binding, which classes provide,
and recursion via class type abstraction works fine
across module boundaries.

The big problem with classes is *intramodule* type recursion,
since mutually recursive class types can't also
recurse with variants and tuples (at least they couldn't
last time I played with them).  To fix this you have to 
make your class polymorphic, and then instantiate
in an ordinary (recursive) type declaration.

Polymorphic variants may help with this since they
don't need to be declared.

John Skaller,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: