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
OO programming
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-02-29 (15:58)
From: Keiko Nakata <keiko@k...>
Subject: Re: [Caml-list] OO programming
> > Since there are some people (including me) 
> > who are interested in using functors and recursive modules 
> > in the style of object-oriented context, 
> >   
> Do you mean including classes in functors, as Jacques Garrigue 
> described, or using modules like classes ?

The former; to include classes in functors. 

> > I thought that it could be useful to devise 
> > a (camlp4) syntax extension which mitigates this a bit painful verbosity.
> camlp4 extensions may help. I already used some for objects (related to 
> initializers), and I plan to investigate it further, possibly borrowing 
> code from Jacques Garrigue. In the context of functors, the problem is 
> that a lot of code would probably remain specific and still need to be 
> written by hand, for example, the row types for classes...

As I see Jacques's code, he gradually extends the module type S 
to S' and S''. Type declarations in module types and type definitions
in structures involving types event, observer and subject are duplicated
everywhere with slight modifications. 
Why can we not extend the previously defined module type 
in a less verbose way?

We may still need to write row types by hand. 
But I think we should (ideally) do it in a extensible way without duplications. 

With best regards,