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

  1. Path: sparky!uunet!mcsun!news.funet.fi!news.cs.tut.fi!tut!pk
  2. From: pk@cs.tut.fi (Kellom{ki Pertti)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: Something I don't understand about bindings
  5. Date: 16 Dec 92 09:41:09
  6. Organization: Tampere Univ. of Technology, Finland.
  7. Lines: 31
  8. Distribution: world
  9. Message-ID: <PK.92Dec16094109@talitiainen.cs.tut.fi>
  10. References: <a2vogler.724431792@rzdspc23> <1gl348INNp83@news.aero.org>
  11.     <HANCHE.92Dec15134343@ptolemy.ams.sunysb.edu>
  12.     <1glic3INNq5b@news.aero.org>
  13. NNTP-Posting-Host: talitiainen.cs.tut.fi
  14. In-reply-to: doner@Aero.org's message of 15 Dec 1992 21:23:15 GMT
  15.  
  16. In article <1glic3INNq5b@news.aero.org> doner@Aero.org (John Doner) writes:
  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. Which in turn is equivalent to
  30.  
  31.   (define timed-prime-test
  32.      (lambda (n)
  33.         (letrec ((start-time (runtime))
  34.              ...)
  35.  
  36. Btw, there is nothing in R4RS that says that an implementation can not
  37. evaluate the init values of a letrec in left to right order, so the
  38. original code *could* work with a R4RS conforming Scheme. It is just not
  39. required to work --- another nasty thing about evaluation order that
  40. can bite you.
  41. --
  42. Pertti Kellom\"aki (TeX format)  #       These opinions are mine, 
  43.   Tampere Univ. of TeXnology     #              ALL MINE !
  44.       Software Systems Lab       #  (but go ahead and use them, if you like)
  45.  
  46.  
  47.