home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19764 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  5.4 KB

  1. Xref: sparky comp.lang.c++:19764 comp.object:5002
  2. Path: sparky!uunet!olivea!pagesat!spssig.spss.com!uchinews!alex!dave
  3. From: dave@alex.uchicago.edu (Dave Griffith)
  4. Newsgroups: comp.lang.c++,comp.object
  5. Subject: Re: Pros and cons of C++
  6. Message-ID: <1993Jan22.155414.11675@midway.uchicago.edu>
  7. Date: 22 Jan 93 15:54:14 GMT
  8. References: <1993Jan21.200817.10226@neptune.inf.ethz.ch> <1993Jan21.231618.8962@midway.uchicago.edu> <1993Jan22.142518.22644@neptune.inf.ethz.ch>
  9. Sender: news@uchinews.uchicago.edu (News System)
  10. Organization: University of Chicago
  11. Lines: 97
  12.  
  13. In article <1993Jan22.142518.22644@neptune.inf.ethz.ch> santas@inf.ethz.ch (Philip Santas) writes:
  14. >In article <1993Jan21.231618.8962@midway.uchicago.edu> dave@alex.uchicago.edu (Dave Griffith) writes:
  15. >> santas@inf.ethz.ch (Philip Santas) writes:
  16. >>
  17. >>You have asserted that this is not a problem in languages in which primitives
  18. >>are classes (Smalltalk, Axiom/Scratchpad).  The problems I discussed are
  19. >>still present in those systems.  C++'s (IMHO) inconsistent design decision to 
  20. >>treat primitives as non-class types is hardly a point in it's favor.
  21. >
  22. >What I said is that you cannot redefine the primitives, and I gave you
  23. >the reason why. I have never said that this separate treating is of any
  24. >language's favour. (you definitely have a way of "inventing" statements
  25. >and atribute them to other people :-(  )
  26. >
  27.  
  28. I never suggested that you did suggest any such thing.  You're the one 
  29. inventing statements here.
  30.  
  31. >>>I understand that you want to substitute a symbol, say "=", with one value
  32. >>>all over your formalism, but the fact that you cannot do it, does not mean
  33. >>>that the language is complex, it means that you have to find another way
  34. >>>to deal with it. Furthermore, people feel comfortable with operators
  35. >>>like "+" and "*" which have been primitevely overloaded for reals, integers, 
  36. >>>etc. There is no reason why not to treat "=" in the same way.
  37. >>
  38. >>If you've still got the archive, the value/object discussion of a month 
  39. >>ago makes my position pretty clear on this subject, in probably overly
  40. >>deep detail. 
  41. >
  42. >To what extend has this been covered by the object/value discussion?
  43. >
  44.  
  45. I made at least three prior postings on precisely this point.  
  46.  
  47.  
  48. >>>Notice also that we deal with a non-trivial type system (I do not discuss
  49. >>>how it is implemented, this is another story)
  50. >>>Denotational semantics have elegant approaches on simple type systems,
  51. >>>but for more complicated ones they are confusing. Notice that by
  52. >>>assuming _traditional_ subclassing, you have a form of overloading "=",
  53. >>>since the objects have (od do not have) to coerce to the superclasses
  54. >>>in many cases. This overloading occurs with every link you add.
  55. >>
  56. >>Nonsense.  In traditional subclassing, there is no concept of coercing to
  57. >>the superclass at all.  Coercions, if they occur, are utterly orthogonal to
  58. >>the subclassing heirarchy.  C++ implements this _very_ poorly (truncating
  59. >>objects if passed by value!) but calling this traditional inheritance is
  60. >>just wrong.
  61. >
  62. >I hope you are familiar with the terms "reference semantics" and "value semantics".
  63. >Coercions do occur when you move the object to the superclass in "value semantics".
  64. >Are you saying that traditional subclassing does not involve values?
  65. >
  66. >Furthermore, you definitely coerce an object when you move it to the superclass,
  67. >since you alter its behaviour. If you don't believe me, make equality tests
  68. >on objects of differnt classes (which are at the same inheritance path).
  69. >
  70.  
  71. You're stuck in C++ here.  This is not the case in many other OO languages,
  72. and in only makes sense in C++ because of it's C roots showing through.  In
  73. Smalltalk and Eiffel, everything you describe would be just overly baroque 
  74. nonsense.
  75.  
  76. >>As much as I would love to spend the next decade (a conservative estimate)
  77. >>working on a formal definition of C++, I'm forced to pass.  Even suggesting 
  78. >>that someone might need to put in that huge amount of work to prove this 
  79. >>utterly trivial point weakens your case.
  80. >
  81. >"trivial point" = "I don't know how to prove it" :-(   
  82. >Right?
  83. >
  84.  
  85. No, trivial point means that, even if one of us convinces the other, it 
  86. will make not the slightest difference to the programs we write or languages 
  87. we define.  I have never in this thread argued against overriding primitives,
  88. just that, in a well designed OO language, this is a source of complexity
  89. and should be treated as such.  If it was a _bad_ idea, I wouldn't be 
  90. including overridable equality in my language.  You have never shown that
  91. you actually knew enough about formal semantics to view my original statement
  92. as more than a C++ flame to which a knee-jerk response was needed.
  93.  
  94. A formal definition of Ada without concurrency took over six man years to
  95. produce (NYU, if I remember correctly).  Ada without concurrency is a 
  96. much simpler language than C++.  Fewer types, fewer control primitives,
  97. less dynamism, less overriding.  As such, a decade seemed a reasonable
  98. time frame for a formal C++ defn.  You indicated that such a defn. would
  99. be the only argument you would accept. and I declined.  Are you willing 
  100. to spend ten years proving your side of this argument?  Of course not, you're
  101. not even willing to spend ten seconds apologizing for flaming.
  102.  
  103. I again request that we take this to e-mail.
  104.  
  105. -- 
  106. Dave Griffith, Information Resources, University of Chicago,
  107. Department of Surgery                       dave@alex.bsd.uchicago.edu
  108. When buying and selling are controlled by legislation, the first things bought
  109. and sold are legislators.
  110.