Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gatech!swrinde!cs.utexas.edu!news.sprintlink.net!noc.netcom.net!ix.netcom.com!netcom.com!netcom4!haahr
From: haahr@netcom.com (Paul Haahr)
Subject: Re: What's a generic function?
In-Reply-To: mbk@jt3ws1.etd.ornl.gov's message of 16 Apr 1995 22:43:37 GMT
Message-ID: <HAAHR.95Apr18142420@netcom4.netcom.com>
Sender: haahr@netcom4.netcom.com
Organization: NETCOM On-line services
References: <3mnrf2$288r@acs6.acs.ucalgary.ca> <3mq5av$pd5@lll-winken.llnl.gov>
	<3ms6ip$4rf@stc06.ctd.ornl.gov>
Date: Tue, 18 Apr 1995 13:24:19 GMT
Lines: 26

mbk@jt3ws1.etd.ornl.gov (Kennel) wrote:
> Patrick C. Beard (beard@cs.ucdavis.edu) wrote:
> > [...] and the proper function will be selected for you. Generic
> > functions are even more powerful than this, but this should help you
> > understand what you read in the DIRM.
> 
> Is the choice of "which actual method to call" made at compile time or
> run-time?

It depends.

> I imagine that some sort of call makes this at runtime, but is there
> a way to have a "generic" call be made at compile time?

Sealing, sketched out in the ``controlling dynamism'' chapter of the
DIRM, is intended to allow implementations to move generic function
dispatch to compile-time, under the author's control.

The thing to note is that it is sometimes correct to move dispatching to
compile-time, but sometimes that would be wrong.  Sealing in Dylan has
richer (but more complex) semantics than C++'s distinction between
virtual and non-virtual member function, but, to first order, they serve
the same goal:  to control which dispatches you can do at compile-time.
(A related aspect is which operations can be overridden.)

Paul
