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

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!olivea!tymix!grimoire!mooring
  2. From: mooring@grimoire.tymnet.com (Ed Mooring)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: Problem with order of precedence, maybe
  5. Message-ID: <2178@tymix.Tymnet.COM>
  6. Date: 30 Jul 92 19:33:31 GMT
  7. References: <sherman.712450219@foster> <1992Jul30.150500.9873@convex.com>
  8. Sender: usenet@tymix.Tymnet.COM
  9. Organization: BT Tymnet Bit Bucket Brigade
  10. Lines: 26
  11. Nntp-Posting-Host: grimoire
  12.  
  13. In article <1992Jul30.150500.9873@convex.com> tchrist@convex.COM (Tom Christiansen) writes:
  14. >From the keyboard of sherman@unx.sas.com (Chris Sherman):
  15. >:Consider the following code:
  16. >:
  17.     [ test program to uncover a bug written by yours truly ]
  18.  
  19. >Check K&R: == and != bind more tightly than &.  Unfortunately,
  20. >they bind less tightly than &&, which is why people want get
  21. >confused.  I just tracked down a dozen cases of this in our
  22. >kernel and utils source (in C).
  23. >
  24. >--tom
  25.  
  26. It only slightly relieves my embarassment that I'm not the only
  27. one who suffered this lapse, especially in light of the warnings
  28. from The One True Man Page:
  29.  
  30.          When in doubt, parenthesize.  At the very least it  will
  31.          let some poor schmuck bounce on the % key in vi.
  32.  
  33.          Even if you aren't in doubt, consider the mental welfare
  34.          of  the  person  who has to maintain the code after you,
  35.          and who will probably put parens in the wrong place.
  36.  
  37. Regards,
  38. Ed Mooring (mooring@tymix.tymnet.com 408-922-7504)
  39.