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