home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11230 < prev    next >
Encoding:
Internet Message Format  |  1992-07-21  |  2.9 KB

  1. Path: sparky!uunet!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!think.com!linus!linus.mitre.org!virtual
  2. From: pathak@mitre.org (Heeren Pathak)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Language extensions for run-time type identification
  5. Message-ID: <pathak-210792110123@virtual.mitre.org>
  6. Date: 21 Jul 92 15:36:25 GMT
  7. References: <EY048MK@netmbx.netmbx.de> <pathak-200792135100@virtual.mitre.org> <N3A5KQD@netmbx.netmbx.de>
  8. Sender: news@linus.mitre.org (News Service)
  9. Followup-To: comp.lang.c++,comp.std.c++
  10. Organization: Mitre Corporation
  11. Lines: 55
  12. Nntp-Posting-Host: virtual.mitre.org
  13.  
  14. In article <N3A5KQD@netmbx.netmbx.de>, jrobie@netmbx.netmbx.de (Jonathan
  15. Robie) wrote:
  16. > pathak@mitre.org (Heeren Pathak) writes:
  17. > >In article <EY048MK@netmbx.netmbx.de>, jrobie@netmbx.netmbx.de (Jonathan
  18. > >Robie) wrote:
  19. > >> 
  20. > >> shang@corp.mot.com (David (Lujun) Shang) writes:
  21. > >> 
  22. > >> >The language should provide run time type checking as well as array bounds  
  23. > >> >checking. You can also have a switch to turn off them if you like to.
  24. > >> >  
  25. > >> 
  26. > >> It may be important for compilers to provide such a switch since the
  27. > >> memory overhead needed to store type information for all classes can
  28. > >> be significant.  Pragmas would be necessary to switch it on and off
  29. > >> since you might need it for some classes but not for others....messy,
  30. > >> isn't it?
  31. > >> 
  32. > >Why not use MI to provide a "standard" mix-in class that provides run-time
  33. > >identification?  
  34. > I assume you mean that this class would give access to the run-time
  35.  
  36. This is exactly what I meant.
  37.  
  38. > identification provided by the compiler, right?  That might make sense,
  39. > but I don't like the idea of making the compiler look at the derivation
  40. > tree to see whether it should generate run time identification.
  41.  
  42. I don't see how this is any worse than using pragmas or having a new
  43. keyword to identify objects that use run-time identification.  Could you
  44. explain the problem with the complier looking at the derivation tree?  From
  45. my viewpoint, run-time id would be another characteristic of a class and
  46. all classes derived from it.  
  47.  
  48. > Obviously, no class is going to be able to generate run time identification
  49. > for objects including it or derived from it.  How should it know the
  50. > relevant types?
  51.  
  52. Well, if the complier uses the class tree when it determines the type, it
  53. can generate "proper" run-time id for all objects in the tree.  That is I
  54. suggest that people look at using MI instead of pragmas.  
  55.  
  56. -------------------------------------------------------------------------
  57. Heeren Pathak                      | Television is a device that permits
  58. pathak@mitre.org                   | people who haven't anything to do to
  59. Mitre Corporation                  | watch people who can't do anything.
  60. (617) 271-7465                     |                       -- Fred Allen
  61. -------------------------------------------------------------------------
  62. Disclaimer: Mine not Mitre's.
  63.