Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Lazy evaluation
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Implementation== Some programming languages delay evaluation of expressions by default, and some others provide [[subroutine|functions]] or special [[syntax of programming languages|syntax]] to delay evaluation. In [[KRC (programming language)|KRC]], [[Miranda (programming language)|Miranda]] and [[Haskell]], evaluation of function arguments is delayed by default. In many other languages, evaluation can be delayed by explicitly suspending the computation using special syntax (as with [[Scheme (programming language)|Scheme's]] "<code>delay</code>" and "<code>force</code>" and [[OCaml]]'s "<code>lazy</code>" and "<code>Lazy.force</code>") or, more generally, by wrapping the expression in a [[thunk (delayed computation)|thunk]]. The object representing such an explicitly delayed evaluation is called a ''[[lazy future]].'' [[Raku (programming language)|Raku]] uses lazy evaluation of lists, so one can assign infinite lists to variables and use them as arguments to functions, but unlike Haskell and Miranda, Raku does not use lazy evaluation of arithmetic operators and functions by default.<ref name="Wadler2006"/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)