home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / std / cplus / 1171 < prev    next >
Encoding:
Internet Message Format  |  1992-09-13  |  2.1 KB

  1. Xref: sparky comp.std.c++:1171 comp.lang.c++:13589
  2. Newsgroups: comp.std.c++,comp.lang.c++
  3. Path: sparky!uunet!spool.mu.edu!sol.ctr.columbia.edu!eff!world!rr
  4. From: rr@world.std.com (Robert I Ransbottom)
  5. Subject: Re: Exponentiation operator proposal
  6. Message-ID: <BuJJxs.8Hx@world.std.com>
  7. Summary: ^^ better than ** or *^
  8. Organization: The World Public Access UNIX, Brookline, MA
  9. References: <23660@alice.att.com> <1992Sep13.193507.27813@ima.isc.com>
  10. Date: Sun, 13 Sep 1992 23:58:39 GMT
  11. Lines: 40
  12.  
  13. In article <1992Sep13.193507.27813@ima.isc.com> karl@ima.isc.com (Karl Heuer) writes:
  14. >In article <23660@alice.att.com> bs@alice.att.com (Bjarne Stroustrup) writes:
  15.  
  16. >>Comments on Mat Austern's proposal for an exponentiation operator
  17.  
  18. >>[By defining `**' to have semantics of TIMES FETCH when the right operand
  19.  
  20. >I considered this when I wrote my exponentiation essay.  I decided that it
  21. >might be possible, but it's way too confusing!  This would be a kludge of the
  22. >highest order.  It's much better to use syntax that's not already taken --
  23. >I've adopted "*^", as suggested by someone else some years ago.  (A hybrid of
  24. >"**" and "^", sort of.)
  25.  
  26. I agree ** is confusing, given the potential frequency of both "dat**ptr" and
  27. "dat**dat" it seems like a waste to deciphering such.  The proponents
  28. of **expon want a convenience. 
  29.  
  30. I think that ^^ would be more satisfying to both pointer-ers and math-ers.  
  31.  
  32.     1. Its not already taken!
  33.     2. Its not already taken!
  34.     3. Its not already taken!
  35.     .   .   .    .      .
  36.     .   .   .    .      .
  37.     n. Its easier to type than Karl's *^. 
  38.     n+1. No more damaging if mistyped.
  39.     n+2. The contexts of exponentiation and exclusive-or have less overlap
  40.         than multiplication & indirection and exponentiation.
  41.  
  42. My vote is behind a keyword like
  43.  
  44.     operator consistent { *=, /=, -=, += }
  45.  
  46. which would shorthand consistent derivatives  X= from X and =.
  47. The longhand is simple enough to generate, but is more difficult to
  48. read/verify given alien code.
  49. -- 
  50. rr@world.std.com  Robert Ransbottom
  51.  
  52. "Maintaining correct attributions is extremely important." -- anonymous
  53.