home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / tcl / 2490 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.6 KB  |  40 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!ukma!darwin.sura.net!sgiblab!newsun!news
  3. From: Duane Murphy <damurphy@wc.novell.com>
  4. Subject: Re: Multiple Interpreters
  5. Message-ID: <1993Jan28.210510.17299@novell.com>
  6. X-Xxdate: Thu, 28 Jan 93 21:12:47 GMT
  7. Sender: news@novell.com (The Netnews Manager)
  8. Nntp-Posting-Host: 130.57.72.123
  9. Organization: Novell, Inc.
  10. X-Useragent: Nuntius v1.1.1d12
  11. References: <1993Jan28.173729.29095@twg.com>
  12. Date: Thu, 28 Jan 1993 21:05:10 GMT
  13. Lines: 25
  14.  
  15. David Herron, david@twg.com writes:
  16. >`unknown' looks for unknown commands in its parent before it looks
  17. >in MainInterp.  Yes that's not quite the same thing as inheritance.
  18. >The other inheritance facility is `-chainCommand' (if someone can suggest
  19. >improved names for these things, I'm all ears...).  Again, it's manual
  20. >but works like:
  21. >
  22. >    interp newInterp
  23. >    foreach cmd { a list of commands to inherit } {
  24. >        newInterp -chainCommand $cmd parentInterp
  25. >    }
  26.  
  27. It is interesting to note that you have actually solved a short coming of 
  28. typical objkect-oriented inheritance.  That is when you inherit you get 
  29. everything the parent has and add new features.  Taking away features is 
  30. actually quite difficult (not impossible, just not straightforward).  
  31. With this method, you pick what you want to inherit from the parent.
  32.  
  33. ...dam
  34.  
  35.   +------------------------+--------------------------------------------+
  36.   | Duane Murphy           | My opinions are mine, mine, and only mine; |
  37.   | damurphy@wc.novell.com |      Except when they are also yours.      |
  38.   | Macintosh Software QA  |                                            |
  39.   +------------------------+--------------------------------------------+
  40.