On 2013-10-23 17:26, robin wrote:
>
>> In Rexx, this could be written with no (explicit) branches
>> as:
>>
>>    m = ( j > k ) - ( j < k );
>
> In PL/I,
>    m = sign(j-k);
>
The objective was to synthesize sign() in a language such as
Rexx which, unlike PL/I, lacks it.  I have occasionally gotten
flamboyant and coded such as:

    X = copies( 'gubbins', A==B )  /* instead of:  */

    if A==B
        then X = 'gubbins'
        else X = ''

Clearly, I've been polluted by excessive exposure to CDC 6600,
whose programmers went to extremes to avoid branches which
might break pipelining.


On 2013-10-23 15:09, John Gilmore wrote:
> Boolean values are bits in PL/I.
>     ...
> but nothing quite like your REXX construct is available.
>
IOW, PL/I provides no coercion from boolean (bit) values to
integer?

("[my] REXX construct"?  It's conventional; I lay no claim
to originality.)

--- gil

Reply via email to