From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA19554; Wed, 22 Sep 2004 12:30:01 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA23210 for ; Wed, 22 Sep 2004 12:30:00 +0200 (MET DST) Received: from annexia.force9.co.uk (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i8MATxtu019231 for ; Wed, 22 Sep 2004 12:29:59 +0200 Received: from rich by annexia.force9.co.uk with local (Exim 3.36 #1 (Debian)) id 1CA4Nr-0005g5-00 for ; Wed, 22 Sep 2004 11:29:59 +0100 Date: Wed, 22 Sep 2004 11:29:59 +0100 To: caml-list Subject: Re: [Caml-list] Re: OCAML Downcasting? Message-ID: <20040922102959.GA21645@annexia.org> References: <87isa76z7g.fsf@qrnik.zagroda> <1095819964.2580.1016.camel@pelican.wigram> <87d60eizlh.fsf@qrnik.zagroda> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline In-Reply-To: <87d60eizlh.fsf@qrnik.zagroda> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at concorde with ID 41515427.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 downcasting:01 2004:99 marcin:01 'qrczak':01 kowalczyk:01 sourceforge:01 downcasts:01 downcast:01 struct:01 monolithic:01 reuse:01 reuse:01 ltd:98 compiler:01 X-Attachments: type="application/pgp-signature" name="signature.asc" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 22, 2004 at 08:31:38AM +0200, Marcin 'Qrczak' Kowalczyk wrote: > skaller writes: >=20 > >> Attempts to avoid downcasts are often unmodular, they require to > >> specify all possible variants in one place. > > > > It makes no difference. You have do specify them all anyhow, > > downcast or not. >=20 > It makes a difference because specifying them at the type definition > would introduce a dependency loop between modules. And it would be > unmodular: it would require changing some base module whenever a far > client module is added. I've tended to stop using and thinking in OO terms since starting to use OCaml. In particular, when I need a data structure of some sort, I just use a data structure (tuple, struct, variant whatever). Before coming to OCaml, data structure implied "class" for me. The advantage to me is that now when I change the data structure the compiler catches all the places in the code which I need to change, so I go through and methodically change them. But the OCaml assumption here is that you program is one big monolithic entity, for which you have source (and are recompiling) all parts. This goes against the OO theory of "reuse" - particularly of reuse of binary classes, which I don't think I've ever actually used in practice anyway. Rich. --=20 Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment NET::FTPSERVER is a full-featured, secure, configurable, database-backed FTP server written in Perl: http://www.annexia.org/freeware/netftpserver/ --wRRV7LY7NUeQGEoC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQFBUVQn4le1M6q9pzoRAiMeAKCsQPx1tYC4ucaxc3YyuyqCZfhdZwCbBjiG EpQb64itgUdo+IXazNgChkQ= =hHfE -----END PGP SIGNATURE----- --wRRV7LY7NUeQGEoC-- ------------------- 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