home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / object / 3273 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  1.8 KB

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