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 CAA10159; Wed, 11 Sep 2002 02:25:37 +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 CAA10123 for ; Wed, 11 Sep 2002 02:25:36 +0200 (MET DST) Received: from lobus.fungible.com (adsl-64-161-114-6.dsl.snfc21.pacbell.net [64.161.114.6]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8B0PY128895 for ; Wed, 11 Sep 2002 02:25:35 +0200 (MET DST) Received: by lobus.fungible.com (Postfix, from userid 1000) id 088C57F4F; Tue, 10 Sep 2002 17:25:31 -0700 (PDT) Date: Tue, 10 Sep 2002 17:16:44 -0700 From-Tims-Fingers: true To: jhw@wetware.com Cc: alex@baretta.com, caml-list@inria.fr In-reply-to: (message from james woodyatt on Fri, 6 Sep 2002 14:15:39 -0700) Subject: Re: [Caml-list] Allow declaring classes "final" so self type has no type variables? References: Message-Id: <20020911002531.088C57F4F@lobus.fungible.com> From: tim@fungible.com (Tim Freeman) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Friday, Sep 6, 2002, at 13:38 US/Pacific, Alessandro Baretta wrote: > I don't think this is what he meant. I agree. > I think he would like to > "finalize" a class for efficiency purposes as opposed to "safety" > purposes. Well, I actually wanted the class to be final so its "self" didn't have to be polymorphic while it was being defined. It's harder to get the types to work out when some of the type variables running around are useless. No big deal, though. > He is asking for some compiler magic. I agree. From: james woodyatt >The opportunity to optimize method dispatch simply isn't there. I agree. I had the idea because the documentation for Java says that methods on finalized objects are faster. The difference is that in Java two objects are the same type if they have the same declaration, so it's practical to find *the* declaration for the class of an object and thus find out if the class is final. In OCAML two objects are the same type if they have the same bag of methods, more or less, so there is no unique class declaration that can be discovered to be final or not. -- Tim Freeman tim@fungible.com GPG public key fingerprint ECDF 46F8 3B80 BB9E 575D 7180 76DF FE00 34B1 5C78 ------------------- 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