English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Functors and classes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-08-03 (15:27)
From: John Prevost <j.prevost@g...>
Subject: Re: [Caml-list] Functors and classes
On Tue, 3 Aug 2004 16:12:41 +0100, Richard Jones <rich@annexia.org> wrote:
> Thanks.  I understand what you're getting at here, and it kind of
> reflects the way that lablgtk hides the 'new' operator too, although
> I'm not sure if that's for the same reasons.  Looks like a
> backwards-compatible change to the Dbi module interfaces is required.

Actually, there's another issue.  The row type defining the methods is
visible from outside the functor, but not from inside.  I'm... er...
not sure how to solve this one.  If nobody else has answered, I'll
fiddle some more this evening when I'm done with work.


Example of what causes the compile to fail (using one of the methods
we want to see):

module type ThingPoolT =
    type 'a connection
    val connect : unit -> connection
    val test : connection -> unit

module ThingPool (Thing : ThingIntf) :
    (ThingPoolT with type connection = Thing.connection) =
    type connection = Thing.connection
    let connect () = Thing.connect ()
    let test x = x#a + 1 

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners