Control structures yielding a value

The execution of a paragraph or a choice can also <#1523#>yield<#1523#> a value, namely that of the last unit executed. The paragraph


#litout1704#

suggests that first the integers 1, 2, ... 10 are summed up, resulting in a value of 55, and then the value 56 is yielded by that paragraph. If the last unit of a paragraph yields a value, then the paragraph as a whole yields that value.

In case of a choice, the value yielded is that of the paragraph in the then-part or in the else-part, depending on the condition. These values must have the same type. As an example, the unit


#litout1706#

yields the smaller of the two integer values <#1528#>a<#1528#> and <#1529#>b<#1529#>. Repetitions cannot yield a value.