Paradigm: Non-strict

Non-strict programming allows the programmer to define non-strict functions.

A non-strict function is a function which which doesn’t require all its parameters to be evaluated completely before the function call. Functions with several parameters can be strict or non-strict in each parameter, as well as jointly strict in several parameters.

Even in strict programming languages some of control structures and operations can be thought of as non-strict in some parameters. For example, if-then-else control structure can be represented as a function of three parameters F(condition, true-expression, false-expression). This function is:

  • strict in its first parameter (condition is necessary to decide which of expressions to return),
  • non-strict in each of second and third parameters (F(true, true-expression, undefined) = true_expression, F(false, undefined, false-expression) = false_expression),
  • and jointly strict in second and third parameters (F(true, undefined, undefined) = F(false, undefined, undefined) = undefined).

Similarily, logical AND and OR operations are non-strict in each parameter and jointly strict in both parameters: false AND undefined = undefined AND false = false, true OR undefined = undefined OR true = true.

Non-strict programming is the opposite of strict programming.

Programming languages that support this paradigm: