home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / scheme / 2779 < prev    next >
Encoding:
Internet Message Format  |  1992-12-17  |  2.0 KB

  1. Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!spool.mu.edu!umn.edu!noc.msc.net!gacvx2.gac.edu!nntp-server!max
  2. Newsgroups: comp.lang.scheme
  3. Subject: Re: Something I don't understand about bindings
  4. Message-ID: <MAX.92Dec16143412@Kolmogorov.gac.edu>
  5. From: max@Kolmogorov.gac.edu (Max Hailperin)
  6. Date: 16 Dec 92 14:34:12
  7. Reply-To: Max Hailperin <max@nic.gac.edu>
  8. References: <a2vogler.724431792@rzdspc23> <1gl348INNp83@news.aero.org><HANCHE.92Dec15134343@ptolemy.ams.sunysb.edu><1glic3INNq5b@news.aero.org>
  9. Distribution: world
  10. Organization: Gustavus Adolphus College, St. Peter, MN
  11. Nntp-Posting-Host: kolmogorov.gac.edu
  12. In-reply-to: doner@Aero.org's message of 15 Dec 1992 21:23:15 GMTLines: 28
  13. Lines: 28
  14.  
  15. In article <1glic3INNq5b@news.aero.org> doner@Aero.org (John Doner) writes:
  16.  
  17.    ... On the other hand, his original define (again according to r4rs) is
  18.    equivalent to
  19.  
  20.            (define timed-prime-test
  21.                    (lambda (n)
  22.                            (define start-time (runtime))
  23.                            (define found-prime? (prime? n))
  24.                            .
  25.                            .
  26.                            .
  27.                                    ))
  28.  
  29.    So the sequence of expressions beginning with the inner defines is
  30.    the body of a lambda expression.  And r4rs says the expressions in
  31.    the body of a lambda expression are to be evaluated sequentially....
  32.  
  33. Ahhh..., but they *aren't* expressions.  Read R4RS carefully and you
  34. will find that a definition is not an expression.  Thus the fact that
  35. the body *expressions* are evaluated in order is irrelevant, and
  36. indeed the SICP code quoted will not necessarily work in all
  37. R4RS-compliant scheme implementations (though contrary to how some
  38. might read the previous post, a scheme implementation in which the
  39. code works is not thereby non-R4RS-compliant).  Note, btw, that the
  40. code everyone has been talking about long predates R4RS, and that the
  41. authors specifically admitted in the instructors manual that it was a
  42. mistake.
  43.