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 IAA11994; Wed, 28 Apr 2004 08:53:10 +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 IAA12008 for ; Wed, 28 Apr 2004 08:53:08 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3S6r6YM028526 for ; Wed, 28 Apr 2004 08:53:07 +0200 Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3p2-20030924/3.7W) with ESMTP id PAA23524; Wed, 28 Apr 2004 15:52:58 +0900 (JST) Date: Wed, 28 Apr 2004 15:52:58 +0900 (JST) Message-Id: <20040428.155258.93638007.garrigue@kurims.kyoto-u.ac.jp> To: warplayer@free.fr Cc: yoriyuki@mbg.ocn.ne.jp, caml-list@inria.fr Subject: Re: [Caml-list] Re: Common IO structure From: Jacques GARRIGUE In-Reply-To: <016301c42b9a$7a61bc40$ef01a8c0@warp> References: <20040426.221606.71081508.yoriyuki@mbg.ocn.ne.jp> <20040426.225318.68533471.garrigue@kurims.kyoto-u.ac.jp> <016301c42b9a$7a61bc40$ef01a8c0@warp> X-Mailer: Mew version 4.0.64 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 jacques:01 cannasse:01 warplayer:01 subtyping:01 recursion:01 jacques:01 ocaml:01 equality:01 equality:01 nicolas:01 garrigue:01 garrigue:01 interfaces:01 polymorphic:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: "Nicolas Cannasse" > > This also emphasizes one of the advantages of objects: since their > > types can be compared for equality, several libraries can use the same > > type without requiring a common header (that is, if everybody agrees > > on the interface, as you suggest). > > Is there any chance of getting the same behavior with records ? > Records are currently module-bounded, if Ocaml was enabling structural > comparison (even without subtyping) it would be very useful. With the current records? There are some obstacles, like the fact records allow polymorphic recursion, makeing impossible to check structural equality. Or the fact that the order of members is relevant, meaning that you would only get a weak equality anyway. New polymorphic records? I would rather try to make objects easier to use, as they are certainly more powerful. All the current discussion on IO suggests that you cannot only define one minimal interface, but actually need a hierarchy of interfaces. Jacques Garrigue ------------------- 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