home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12337 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  2.1 KB

  1. Xref: sparky comp.lang.c++:12337 comp.std.c++:1082
  2. Path: sparky!uunet!sun-barr!olivea!mintaka.lcs.mit.edu!ai-lab!life.ai.mit.edu!tmb
  3. From: tmb@arolla.idiap.ch (Thomas M. Breuel)
  4. Newsgroups: comp.lang.c++,comp.std.c++
  5. Subject: Re: Language extensions for run-time type identification
  6. Message-ID: <TMB.92Aug14125447@arolla.idiap.ch>
  7. Date: 14 Aug 92 16:54:47 GMT
  8. References: <1992Jul23.183041.147@uunet.uu.net!mole-end>
  9.     <1992Jul24.141611.19647@cadsun.corp.mot.com>
  10.     <1992Jul26.014223.6153@uunet.uu.net!mole-end>
  11. Sender: news@ai.mit.edu
  12. Reply-To: tmb@idiap.ch
  13. Followup-To: comp.lang.c++
  14. Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
  15.     Perceptive)
  16. Lines: 34
  17. In-reply-to: mat@uunet.uu.net!mole-end's message of 26 Jul 92 01:42:23 GMT
  18.  
  19. In article <1992Jul26.014223.6153@uunet.uu.net!mole-end> mat@uunet.uu.net!mole-end writes:
  20.  
  21.    How about this:
  22.  
  23.    [1]       Derivation is only useful when used properly with virtualization.
  24.    [2]       Virtualization is only meaningful in the context of derivation.
  25.    [3]       Only derivation can make use of RTTI.
  26.      therefore
  27.        RTTI is only useful in the presence of virtualization.
  28.  
  29. All your premises are wrong.
  30.  
  31.  (1) To the limited extent that derivation is useful at all,
  32.      derivation is useful for reuse of functionality even in the
  33.      absence of virtual functions. I use derivation in C++ more
  34.      frequently than virtual functions. Other languages (Oberon,
  35.      CommonLisp DEFSTRUCT, SML) offer derivation without
  36.      virtualization.
  37.  
  38.  (2) It does make sense to "virtualize" without derivation: you get
  39.      something similar to overloading in C++, except that the
  40.      "overloading" is resolved at runtime. There needs to be no
  41.      inheritance relationship among the types participating in this.
  42.      Among others, CLOS lets you do this.
  43.  
  44.  (3) Users of Lisp and similar languages have made use of RTTI since
  45.      before derivation even became a concept in programming languages.
  46.  
  47. The limitations C++ has in all these areas are consequences of
  48. its heritage and the desire to have low-overhead implementations. But
  49. please let us not re-define reality to fit the special circumstances
  50. of the C++ programming language.
  51.  
  52.                     Thomas.
  53.