home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / std / cplus / 894 < prev    next >
Encoding:
Text File  |  1992-07-21  |  3.2 KB  |  98 lines

  1. Newsgroups: comp.std.c++
  2. Path: sparky!uunet!wupost!darwin.sura.net!mips!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!sunb10.cs.uiuc.edu!sparc1.cs.uiuc.edu!pjl
  3. From: pjl@sparc1.cs.uiuc.edu (Paul Lucas)
  4. Subject: Re: New operators wish list
  5. Message-ID: <1992Jul21.160635.10039@sunb10.cs.uiuc.edu>
  6. Sender: news@sunb10.cs.uiuc.edu
  7. Organization: University of Illinois at Urbana-Champaign
  8. References: <658@manutius.UUCP>
  9. Distribution: usa
  10. Date: Tue, 21 Jul 1992 16:06:35 GMT
  11. Lines: 85
  12.  
  13. In <658@manutius.UUCP> garyp@manutius.UUCP (Gary Powell) writes:
  14.  
  15. >Ok, Ok Ok...lets cut the relgion and get to the meat of the matter.
  16.  
  17. >It appears to me that there are a large number of folks who want the following
  18. >new operators added to the language.
  19.  
  20. >1) ||=
  21.  
  22. >   where:  x ||= y   <==>  x = x || y
  23.  
  24. >   Seems resonable as it matches all the "Blah"= operators.
  25.  
  26. *****>    I would assume (hope?) that the semantics would be similar to
  27.     plain ol' || in that if x is already true, y will not be
  28.     evaluated.
  29.  
  30. >2) &&=
  31.  
  32. >   where:  x &&= y   <==>  x = x && y
  33.  
  34. >   Also seems reasonable for the same issue as #1.
  35.  
  36. *****>    Same idea.
  37.  
  38. >3) ===
  39.  
  40. >   where x === y   <==> x = x == y
  41.  
  42. >   I have more trouble looking at this one, but again it still fits the
  43. >   "blah"= operator rule.  So it maybe that I just haven't thought about
  44. >   it long enough. Anyway I recommend it.
  45.  
  46. *****>    Is this _that_ useful?  For completeness you'd also have to add:
  47.  
  48.         x !== y
  49.         x <== y
  50.         x >== y
  51.         x <= y        // oops! <= is already an operator!
  52.         x >= y        // ditto
  53.  
  54.     How about implication?
  55.  
  56.         x => y     <==>   !x || y
  57.     
  58.     And of course:
  59.  
  60.         x =>= y  <==>    x = x => y
  61.  
  62.     :)  Seriously, I think we're going into operator overload (pun
  63.     intended).  Operators are like Lays (TM) potato chips: you can't
  64.     eat...er...add just one because if you add operator @ someone
  65.     will want (and complain until the cows come home) that operators
  66.     !@ and @= don't exist.
  67.  
  68. >4) some set of chars yet to be determined which bind tighter than the * and /
  69. >   for which x power y  is x raised to the power of y.
  70.  
  71. *****>    I'm not gonna touch this one; basically, I don't care because
  72.     I'll probably only have occasion to use it even less that I use
  73.     floats or doubles...and that's not a lot.
  74.  
  75. >   This seems reasonable but again has the problem of what do we do with
  76. >   the odd ball arguments of y and x?
  77.  
  78. *****>    Hopefully the same things that pow() does so code that switches
  79.     from pow() to whatever won't break.
  80.  
  81. >   I recommend we define it as an operator but leave its implementation alone
  82. >   and let everyone overload it as they see fit. And I don't care which
  83. >   set or single character is chosen. My reasoning is that the current
  84. >   arguments don't seem to be converging.  Maybe someone else (I'm sure I'll
  85. >   see heat on this one.) would care to summarize the arguments on this.
  86.  
  87. >5) "."
  88. >   Lets add this.  I mean really, no one's code will break if we have it,
  89. >   the earth will not shake and the sky fall down.  If it turns out to be
  90. >   not as useful as Jim claims..so what?  We'll drop it from language "D"
  91. >   the next generation.
  92.  
  93. [ ...other commentary deleted... ]
  94. -- 
  95.     - Paul J. Lucas                University of Illinois    
  96.       AT&T Bell Laboratories        at Urbana-Champaign
  97.       Naperville, IL            pjl@cs.uiuc.edu
  98.