home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / scheme / 2847 < prev    next >
Encoding:
Text File  |  1992-12-31  |  3.0 KB  |  58 lines

  1. Newsgroups: comp.lang.scheme
  2. Path: sparky!uunet!psinntp!gatekeeper.nsc.com!voder!woodstock!news
  3. From: dyer@airplane.sharebase.com (Scot Dyer)
  4. Subject: Re: applying or
  5. Message-ID: <1992Dec31.181545.19917@sharebase.com>
  6. Nntp-Posting-Host: airplane
  7. Reply-To: dyer@airplane.sharebase.com (Scot Dyer)
  8. Organization: NCR/ShareBase Corporation
  9. References: <PK.92Dec28100620@talitiainen.cs.tut.fi> <HULTQUIS.92Dec28102345@wk206.nas.nasa.gov> <MOB.92Dec30090646@strident.think.com> <1hsiocINN2v6@columbia.cs.ubc.ca>
  10. Date: Thu, 31 Dec 92 18:15:45 GMT
  11. Lines: 45
  12.  
  13. From: manis@cs.ubc.ca (Vincent Manis)
  14. /// In article <MOB.92Dec30090646@strident.think.com> mob@strident.think.com
  15. /// (Mario O. Bourgoin) writes:
  16. /// >I am at a loss for naming an existing programming language that has AND
  17. /// >and OR and where they do not have the same behavior as they do in Scheme.
  18. /// >Would some programming language cogniscenti be kind enough to name a few?
  19. /// 
  20. /// ISO Pascal, for one. Ada, for another (Ada has both McCarthy and
  21. /// `operator' booleans: I think the former is written `and then', and the
  22. /// latter just as `and').
  23.  
  24. A large number of _later_ Algol derivates contain the 'and then' and 'or then'
  25. control constructs.  The reasoning in seperating them was that in many cases
  26. the conditional evaluation was required for correct code (as in a check for
  27. divide-by-zero or null-pointer-dereference), but that WHERE IT WASN'T
  28. (required) the compiler could generate more efficient code for 'and' and 'or'
  29. by having the choice of which to evaluate "first."  (What's currently in the
  30. machine registers?  Hmmm....)  So take your pick of Algol, Simula, SAIL, etc.
  31.  
  32. I don't believe any of these languages guarantee that all the sub-expressions
  33. will be evaluated*.  I think the biggest difference is whether the compiler is
  34. allowed to try to optimize which order things are eval'ed in.
  35.  
  36. /// The subject of this thread is a clear indication why there's a problem.
  37. /// People insist on thinking of `and' as a procedure, no doubt because many
  38. /// computers have an AND instruction. `and' is a control operation, just as
  39. /// are `if' and `cond'.
  40.  
  41. This is an inconsistancy in Scheme itself, IMHO.  I think the distinction
  42. between "special forms" and "procedures" could be avoided entirely if
  43. "lambda" were revisited.  This would be more expensive, yes, but elegant.
  44.  
  45. Even in Algol, implicit delayed evaluation of procedure parameters was
  46. allowed -- a scary coincidence, yes? :)
  47.  
  48. +------------------------+-----------------------------------------------+
  49. |Scot Dyer_Rivenburgh    | "Land of song," said the warrior bard,     |
  50. |dyer@eagle.sharebase.com| "Though all the world betrays thee,         |
  51. +------------------------+  One sword, at least, thy rights shall guard, |
  52. |(He's right, you know.) |  One faithful harp shall praise thee."     |
  53. +------------------------+-----------------------------------------------+
  54.  
  55. * except ISO Pascal which I know squat about.  It would be wirthian to provide
  56. a "clean operator" (and damn the awkwardness that _everything_ can't be an
  57. "operator!")
  58.