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 HAA13827; Wed, 11 Sep 2002 07:10:55 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 HAA13706 for ; Wed, 11 Sep 2002 07:10:54 +0200 (MET DST) Received: from wetware.wetware.com (wetware.wetware.com [199.108.16.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g8B5Aq923955 for ; Wed, 11 Sep 2002 07:10:53 +0200 (MET DST) Received: from kallisti.local.(ra05.wetware.com[199.108.16.85]) (2063 bytes) by wetware.wetware.com via sendmail with P:esmtp/R:bind_hosts/T:inet_zone_bind_smtp (sender: ) id for ; Tue, 10 Sep 2002 22:10:43 -0700 (PDT) (Smail-3.2.0.114 2001-Aug-6 #1 built 2002-Sep-2) Date: Tue, 10 Sep 2002 22:09:33 -0700 Subject: Re: [Caml-list] Allow declaring classes "final" so self type has no type variables? Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v543) Cc: alex@baretta.com, caml-list@inria.fr To: tim@fungible.com (Tim Freeman) From: james woodyatt In-Reply-To: <20020911002531.088C57F4F@lobus.fungible.com> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.543) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tuesday, Sep 10, 2002, at 17:16 US/Pacific, Tim Freeman wrote: > > Well, I actually wanted the class to be final so its "self" didn't > have to be polymorphic while it was being defined. Well that's problematic, of course. The reason class types are harder to use than record types is basically the same reason that polymorphic variant types are harder to use than regular variant types. Perhaps someone with deeper knowledge of the issue will comment on whether and how it would cause problems if the self type in a class body could be unified with a closed object type. > It's harder to get the types to work out when some of the type > variables running around are useless. I have a technique for avoiding this kind of trouble. Don't use class types where record types and/or functors are sufficient. Keep class types simple, and use signatures to hide internals. When subtyping without method inheritance is all you need, consider using functions and abstract types with polymorphic variants as phantom type parameters. There's a lot you can do with Caml without using the 'object' keyword. Use classes only when all other language facilities are insufficient. > No big deal, though. Okay. Hope I've been helpful anyway. -- j h woodyatt markets are only free to the people who own them. ------------------- 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