From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id AAA16506 for caml-redistribution@pauillac.inria.fr; Tue, 29 Feb 2000 00:07:07 +0100 (MET) Resent-Message-Id: <200002282307.AAA16506@pauillac.inria.fr> Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA16101 for ; Sat, 26 Feb 2000 23:18:08 +0100 (MET) Received: from blazer.intergate.ca ([207.34.179.35]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id XAA08993 for ; Sat, 26 Feb 2000 23:18:05 +0100 (MET) Received: from machiavelli (pm41s23.intergate.bc.ca [207.194.175.186]) by blazer.intergate.ca (8.9.3/8.9.3) with SMTP id OAA23371 for ; Sat, 26 Feb 2000 14:13:05 -0800 Message-ID: <000801bf80a7$4b62e790$baafc2cf@machiavelli> From: "Michael Donat" To: Subject: Re: cyclic dependencies Date: Sat, 26 Feb 2000 14:16:55 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Resent-From: weis@pauillac.inria.fr Resent-Date: Tue, 29 Feb 2000 00:07:07 +0100 Resent-To: caml-redistribution@pauillac.inria.fr I had a similar problem trying to access some (e.g.) print routines in another module. My solution probably isn't the most graceful, but instead of referencing the print routines directly, I accessed them through a reference. The reference is initialized by the module providing the print routines. In other words: To fix moduleA: ... B.print args ... moduleB: ... A.something ... I used moduleA: pv = ref stub;; ... !pv args ... moduleB: ... A.pv := print;; ... A.something ... Of course, module B is really using a subclass of what it's accessing from A, so an object approach might be more appealing (and more correct). Since I only had two functions to deal with, I found the reference approach acceptable. Michael Donat -----Original Message----- From: Juergen Pfitzenmaier To: caml-list@inria.fr Date: Friday, February 25, 2000 9:30 AM Subject: cyclic dependencies >I have a problem with cyclic dependencies between modules. Currently I use the polymorphic >member functions of OLabl 2.04 to access the classes in other dependent modules. But this >is no longer possible in OCaml 2.99. Any suggestions what to do ? > >pfitzen >