Talk:Strict programming language: Difference between revisions

Content deleted Content added
Implementing WP:PIQA (Task 26)
syntaxhighlight & fix lint
 
Line 39:
 
::Consider the following example in typed lambda calculus, which takes a boolean and two functional thunks and returns another thunk:
<syntaxhighlight lang="text">
<code>
&lambda; b : (unit -> a) -> (unit -> a) -> a. &lambda; tr : unit -> a. &lambda; fa : unit -> a. &lambda; u : unit. b tr fa
</syntaxhighlight>
</code>
 
::In this case, b could be a suspended [[Church encoding]] of "true" or "false":
<syntaxhighlight lang="text">
<code>
true := &lambda; tr : unit -> a. &lambda; fa : unit -> a. tr ()
false := &lambda; tr : unit -> a. &lambda; fa : unit -> a. fa ()
</syntaxhighlight>
</code>
 
::So all you really need are functions and unit; non-strictness is just a matter of convenience if you don't want to deal with explicitly invoking your thunks. I won't claim it's not convenient, because it is; but it's not really a matter of expressiveness. --[[User:Donhalcon|bmills]] 19:26, 19 February 2006 (UTC)