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