Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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.

John.


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

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

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

-------------------
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