home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / scheme / 2880 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.4 KB  |  38 lines

  1. Newsgroups: comp.lang.scheme
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!wupost!uwm.edu!daffy!spock.cs.wisc.edu!quale
  3. From: quale@spock.cs.wisc.edu (Doug Quale)
  4. Subject: Re: applying or
  5. Message-ID: <1993Jan7.030412.15056@daffy.cs.wisc.edu>
  6. Sender: news@daffy.cs.wisc.edu (The News)
  7. Organization: University of Wisconsin -- Madison
  8. References: <1993Jan5.165545.11990@neptune.inf.ethz.ch> <1993Jan6.164736.10682@daffy.cs.wisc.edu> <1993Jan6.215411.28927@neptune.inf.ethz.ch>
  9. Date: Thu, 7 Jan 1993 03:04:12 GMT
  10. Lines: 26
  11.  
  12. In article <1993Jan6.215411.28927@neptune.inf.ethz.ch> marti@nugget.inf.ethz.ch (Robert Marti) writes:
  13. >
  14. >However, Wirth himself assumed that Pascal implementations would always
  15. >evaluate both Boolean sub-expressons as can be seen e.g. in his Pascal
  16. >code in the 1st edition of "Algorithms and Data Structures".
  17. >Example:
  18. >  if p <> nil then
  19. >    if p^.key = x then
  20. >      begin
  21. >        (* do something here *)
  22. >      end
  23. >
  24.  
  25. I'm not trying to start a fight, but I read this completely differently.
  26. Wirth recognized that a Pascal implementation *may* evaluate both sides
  27. of the and.  I don't see any way from this example to conclude that
  28. implementations will *always* evaluate both sides.  Because short-circuit
  29. evaluation is not required by Pascal you can never assume it, so you
  30. have to code that way.
  31.  
  32.  
  33.  
  34.  
  35. -- 
  36. Doug Quale
  37. quale@saavik.cs.wisc.edu
  38.