Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: tim@fungible.com (Tim Freeman)
To: jhw@wetware.com
Cc: alex@baretta.com, caml-list@inria.fr
Subject: Re: [Caml-list] Allow declaring classes "final" so self type has no type variables?
Date: Tue, 10 Sep 2002 17:16:44 -0700	[thread overview]
Message-ID: <20020911002531.088C57F4F@lobus.fungible.com> (raw)
In-Reply-To: <CB78D5D0-C1DD-11D6-8D7B-000393BA7EBA@wetware.com> (message from james woodyatt on Fri, 6 Sep 2002 14:15:39 -0700)

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 <jhw@wetware.com>
>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


  reply	other threads:[~2002-09-11  0:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-06 19:12 Tim Freeman
2002-09-06 20:18 ` james woodyatt
2002-09-06 20:38   ` Alessandro Baretta
2002-09-06 21:15     ` james woodyatt
2002-09-11  0:16       ` Tim Freeman [this message]
2002-09-11  5:09         ` james woodyatt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020911002531.088C57F4F@lobus.fungible.com \
    --to=tim@fungible.com \
    --cc=alex@baretta.com \
    --cc=caml-list@inria.fr \
    --cc=jhw@wetware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox