home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16517 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  4.4 KB

  1. Xref: sparky comp.lang.c++:16517 comp.std.c++:1597
  2. Newsgroups: comp.lang.c++,comp.std.c++
  3. Path: sparky!uunet!math.fu-berlin.de!unidui!Germany.EU.net!idtuva!idtsun6!linde
  4. From: linde@idtsun6.kfk.de (Klaus Lindemann)
  5. Subject: Re: The fate of my exponentiation operator proposal
  6. Message-ID: <Bxx60n.Lx5@iai.kfk.de>
  7. Sender: linde@idtsun6 (Klaus Lindemann)
  8. Nntp-Posting-Host: idtsun6
  9. Reply-To: linde@iai.kfk.de
  10. Organization: "Kernforschungszentrum Karlsruhe"
  11. References:  <MATT.92Nov12234242@physics16.berkeley.edu>
  12. Date: Wed, 18 Nov 1992 16:05:10 GMT
  13. Lines: 87
  14.  
  15. In article <MATT.92Nov12234242@physics16.berkeley.edu>, matt@physics16.berkeley.edu (Matt Austern) writes:
  16. |> A while ago, as some of you probably remember, I posted a proposal
  17. |> (X3J16/92-0127 and WG21/N0204) for adding an exponentiation operator
  18. |> to C++.
  19. |> 
  20. |> The extensions working group has considered this proposal and rejected
  21. |> it.  A number of people on the Net have talked about the idea of an
  22. |> exponentiation operator, so I thought they might be interested in
  23. |> hearing the reasons for this decision.
  24. |> 
  25. |>  <stuff deleted>
  26. |> 
  27. |> ------------------------------------------------------------
  28. |> 
  29. |> The proposal was rejected for the following reasons:
  30. |> 
  31. |>  <reasons deleted>
  32. |> 
  33. |> The working group does however favour the suggestion to overload
  34. |> function pow() to take an integer exponent, which would become part of
  35. |> the standard C++ library.
  36. |> 
  37. |> Matthew Austern, the author of the proposal, comments the rejection as
  38. |> follows.  Some detailed comments on the causes of rejection have been
  39. |> omitted.
  40. |> 
  41. |> "I am glad to see that the working group supports adding operator
  42.                                                             ^^^^^^^^
  43.     do you mean operator or function?
  44.  
  45. |> pow(double, int) to the standard library.  Even without an
  46. |> exponentiation operator, this change will be a real benefit, and will
  47. |> rectify a noticeable omission.  As I said in my original proposal,
  48. |> this change will remove all arguments in favor of an exponentiation
  49. |> operator except for the syntactic argument.
  50.  
  51. I think there is another argument in favor of an exponentiation operator: C.
  52. One can add a function pow(double, int) to C++ (because of overloading), but not
  53. to C, you have to choose a name different from pow for this purpose. A real
  54. operator can be added to C also. When modifying C++ for exponentiation, it should
  55. be made in a way which also allows the modification of C.
  56. (One could argue that this argument is of no
  57. importance, because the ANSI-C standard is already too well established, so there is
  58. no way to add a pow(double,int) or a new operator. But I think if a real operator is
  59. added to C++, it will appear also in many available C-compilers, and quickly become
  60. a de-facto standard for C also (which I would like to see)).
  61.  
  62. |> 
  63. |> I believe, however, that it is a mistake to dismiss the importance of
  64. |> syntax so readily.  Syntax matters!  Syntax is the reason why C++
  65. |> (unlike, for example, Objective C) supports operator overloading; for
  66. |> that matter, syntax is the only reason why C++ (again, unlike, for
  67. |> example, lisp) has operators at all.  On a smaller scale, syntax is
  68. |> the reason why the language was extended to permit overloading of both
  69. |> operator++() and operator++(int).
  70. |> 
  71.  
  72. I agree.
  73.  
  74. |> Users of most other languages have found the syntactic convenience of
  75. |> an exponentiation operator to be useful, and I see no reason why C++
  76. |> would be an exception.
  77.  
  78. I agree.
  79.  
  80. |> 
  81. |> I am sorry to see this proposal rejected because I still believe that,
  82. |> of the currently popular languages, C++ is probably the best suited
  83. |> for the type of scientific programs that I write.  The absence of an
  84. |> exponentiation operator, however, will make it harder for me to
  85. |> persuade my colleagues to that point of view."
  86. |> 
  87. |> --
  88. |> Matthew Austern                   Just keep yelling until you attract a
  89. |> (510) 644-2618                    crowd, then a constituency, a movement, a
  90. |> austern@lbl.bitnet                faction, an army!  If you don't have any
  91. |> matt@physics.berkeley.edu         solutions, become a part of the problem!
  92.  
  93. -- 
  94.  
  95. =============================================================================
  96. Klaus Lindemann                        linde@iai.kfk.de (email)
  97. Kernforschungszentrum Karlsruhe GmbH   
  98. Abt. IAI
  99. Postfach 3640                          +49 7247 82 5708 (voice)
  100. 7500 Karlsruhe 1                       +49 7247 82 5786 (Fax)
  101. Germany
  102.