home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14640 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  1.8 KB

  1. Path: sparky!uunet!stanford.edu!unix!mxmora
  2. From: mxmora@unix.SRI.COM (Matt Mora)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: incrementation differences/THINK C 4.0 vs. 5.0
  5. Message-ID: <38188@unix.SRI.COM>
  6. Date: 27 Aug 92 23:01:39 GMT
  7. References: <D2150035.c21d0r@outpost.SF-Bay.org> <1992Aug27.182157.16567@qualcomm.com>
  8. Organization: SRI International, Menlo Park, California
  9. Lines: 52
  10.  
  11. In article <1992Aug27.182157.16567@qualcomm.com> sdorner@qualcom.qualcomm.com (Steve Dorner) writes:
  12.  
  13. >You will never see a C compiler that does this, and if you do you won't
  14. >find me using it.  C is too sparse.  Fix the following fragment:
  15.  
  16. >    a=b=c d=e;
  17.  
  18. >What goes between c and d? I can think of 3 possibilities.
  19.  
  20.  
  21. I entered that line into think c and it said "syntax error" which is
  22. what its supposed to do. It doesn't know what the hell I'm talking about
  23. and shouldn't do anthing in this case. But when I change it to
  24.  
  25.   a=b=c
  26.   d=e;
  27.  
  28. then it selects the first line and say's "Missing ";" ". It knows where
  29. the missing ";" should go.  So it should ask me "Missing ';' at the end
  30. of this line. Should I add one and continue compiling?"
  31.  
  32. "Add and Continue" or "Cancel"
  33.  
  34. Of course you could give a bunch of special cases where it won't know what
  35. to do but why would you want to program like that anyway? :-)
  36.  
  37.  
  38. Is this not a common mistake forgetting the ";"?
  39.  
  40. What about this common bug that I think even shut down ATT long distance
  41. system:
  42.  
  43. if (a=b) {
  44.   //then do something
  45. }
  46.  
  47. When the programmer really meant a==b. Should there be a option to check
  48. if statements?
  49.  
  50. Matt
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. -- 
  59. ___________________________________________________________
  60. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  61. SRI International           |  my unix  mxmora@unix.sri.com
  62. ___________________________________________________________
  63.