home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / function / 960 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.4 KB  |  31 lines

  1. Newsgroups: comp.lang.functional
  2. Path: sparky!uunet!mcsun!sunic!kth.se!dentex.tds.kth.se!kff
  3. From: kff@dentex.tds.kth.se (Karl-Filip Faxen)
  4. Subject: Re: ** LAZY LANGUAGES FASTER?? **
  5. Message-ID: <1992Jul27.130709.13348@kth.se>
  6. Sender: usenet@kth.se (Usenet)
  7. Nntp-Posting-Host: dentex.tds.kth.se
  8. Reply-To: kff@dentex.tds.kth.se (Karl-Filip Faxen)
  9. Organization: Royal Institute of Technology, Stockholm, Sweden
  10. References: <1992Jul24.134857.23289@gdstech.grumman.com> <3737@svin02.info.win.tue.nl>
  11. Date: Mon, 27 Jul 1992 13:07:09 GMT
  12. Lines: 17
  13.  
  14. In article <3737@svin02.info.win.tue.nl>, erik@wsinfo03.win.tue.nl (Erik Poll) writes:
  15.  
  16. |> In lazy languages, an argument is evaluated once for every time that it 
  17. |> is used. 
  18.  
  19. No, in a lazy implementation (and laziness is an implementation related
  20. concept - the corresponding semantic concept is nonstrictness (as Nikhil
  21. pointed out earlier)) an argument to a function is evaluated *at most once*.
  22. A lazy implementation is required to save the result of evaluation for 
  23. later use. What *has* to be done for each use of the argument (in the
  24. absence of strictness analysis) is a check of whether the argument is or
  25. isn't already evaluated, ie if we should evaluate it or use the saved 
  26. result of an earlier evaluation.
  27.  
  28. Karl-Filip
  29. ---------------------------------------------------------------------
  30. Make the frequent case fast, and the fast case frequent!
  31.