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

  1. Xref: sparky comp.lang.c++:11523 comp.std.c++:952
  2. Newsgroups: comp.lang.c++,comp.std.c++
  3. Path: sparky!uunet!mole-end!mat
  4. From: mat@uunet.uu.net!mole-end
  5. Subject: Re: Language extensions for run-time type identification
  6. Message-ID: <1992Jul25.072522.4316@uunet.uu.net!mole-end>
  7. Summary: A union of X, Y, and Z is neither an X nor a Y nor a Z
  8. Organization: :
  9. References: <1992Jul21.094204.20100@mole-end> <1992Jul24.142452.756@ucc.su.OZ.AU>
  10. Date: Sat, 25 Jul 1992 07:25:22 GMT
  11. Lines: 48
  12.  
  13. In article <1992Jul24.142452.756@ucc.su.OZ.AU>, maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  14. > In article <1992Jul23.183041.147@uunet.uu.net!mole-end> mat@uunet.uu.net!mole-end writes:
  15. > >In article <1992Jul22.150330.6160@cadsun.corp.mot.com>, shang@corp.mot.com (David (Lujun) Shang) writes:
  16. > >> In article <1992Jul21.094204.20100@mole-end> mat@mole-end writes:
  17.  
  18.     [much STUFF omitted]
  19.  
  20. > >But without virtualization (polymorphic behavior) derivation is effectively
  21. > >useless.  There is no reason to code inheritance without providing for
  22. > >virtualization.  Then the case which you mention is of no use unless and
  23. > >until it is provided with RTTI; providing RTTI for it using reasonable
  24. > >and economical mechanisms would violate certain assumptions that C++ allows
  25. > >its users to make (C struct compatability).
  26.  
  27. >     But I would make that argument backwards.
  28.  
  29. >     One often wants het. aggregates of unrelated types.
  30. >     Actually, these are aggregates of the *same* type,
  31. > namely, the union of the unrelated types.
  32.  
  33. No, they are aggregates of objects which share some common property
  34. represented by some base type.
  35.  
  36. A union of three types, related or unrelated, is not any of those types.
  37. It is something else.
  38.  
  39. >     On the otherhand, polymorphism is the mechanism by which
  40. > the derived type NEED NOT BE KNOWN. Indeed, if we are to preserve
  41. > the open/closed principle, MUST NOT BE KNOWN.
  42.  
  43. Not so, since the current RTTI proposal would not look past private
  44. derivation.
  45.  
  46. >     So you (well, X3) is considering using RTTI in
  47. > precisely the case it is not needed, and not supplying it
  48. > when it actually could be useful :-)
  49.  
  50. You are offering a type system error (union of A, B, and C as either
  51. an A or a B or a C) instead of using the type system to support the
  52. commonality deliberately programmed into the types.
  53.  
  54. (Anyone got a good intro to either classical or modern category theory?
  55. And I don't mean the mathematical muddle on morphisms ...)
  56. -- 
  57.  (This man's opinions are his own.)
  58.  From mole-end                Mark Terribile
  59.  
  60.  uunet!mole-end!mat, Somewhere in Matawan, NJ
  61.