home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.object:3273 comp.lang.clos:678
- Path: sparky!uunet!think.com!barmar
- From: barmar@think.com (Barry Margolin)
- Newsgroups: comp.object,comp.lang.clos
- Subject: Re: Beginner's Question - CLOS
- Date: 20 Aug 1992 16:06:25 GMT
- Organization: Thinking Machines Corporation, Cambridge MA, USA
- Lines: 27
- Message-ID: <170fu1INNmfh@early-bird.think.com>
- References: <16u2tpINN9ad@early-bird.think.com> <1992Aug19.213818.21709@tfs.com> <DCMARTIN.92Aug19151550@fascet.msi.com>
- NNTP-Posting-Host: telecaster.think.com
-
- In article <DCMARTIN.92Aug19151550@fascet.msi.com> dcmartin@msi.com writes:
- >In article <1992Aug19.213818.21709@tfs.com> eric@tfs.com (Eric Smith) writes:
- >
- > But doesn't that make method dispatch very time consuming? It seems like
- > it would involve searching for the method in tables, and that the amount
- > of time consumed would depend on how many methods were in those tables and
- > how many class arguments each method had.
- >
- >Yes, if you did things that way. In fact, you can determine at compile time
- >what the argument types are and then put in the appropriate call to the
- >appropriate function.
-
- That's not true in general, unless you use some implementation-dependent
- mechanism to tell the compiler that the class named in a specializer or
- type declaration will never have any subclasses, or that these subclasses
- won't override the method. If you don't do this, then an object of a
- subclass may be provided, and it may have its own methods for the generic
- functions. Type declarations can be used to determine which methods
- definitely *won't* be run automatically, but the compiler can't statically
- determine the complete list of methods that *will* be run.
-
- This problem is the reason for Dylan's freezing and sealing concepts.
- --
- Barry Margolin
- System Manager, Thinking Machines Corp.
-
- barmar@think.com {uunet,harvard}!think!barmar
-