Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A thunk is saved state whose evaluation has been postponed.

    a = 1 + 2
    if (condition) {
      print(a)
    }
In a lazy system, if `condition` is not true, then `a` is never evaluated.

This contrived example would be a poor place to have lazy evaluation though, as the overhead of deferring would exceed the cost of computing 1 + 2 up-front.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: