Strict Evaluation

Strict evaluation is where all arguments to a function are evaluated before the body of the function is evaluated; and the arguments are never re-evaluated. In other words, each argument is evaluated exactly once. Compare with Lazy Evaluation and Normal Order Evaluation.

Most languages uses Strict Evaluation for function arguments (though not for macros and some special forms). Scheme Language uses Strict Evaluation by default; by using delay/force one can cause an argument to be evaluated with Lazy Evaluation instead. Some functional languages such as Haskell Language use Lazy Evaluation by default.

Note that Strict Evaluation does not define the order in which arguments are evaluated; that is up to the language. Some languages use left-to-right, others right-to-left; and others (such as Cee Language and Cee Plus Plus) leave this unspecified (any program which depends on the order of evaluation is unportable/ill-formed in such a language).

If all you have is Strict Evaluation, the other forms can be simulated by wrapping the expression to be evaluated in a Lambda Expression, object, thunk, etc.



See original on c2.com