----- Original Message -----
From: "Paul Gilmartin" <[email protected]>
To: <[email protected]>
Sent: Thursday, October 24, 2013 10:43 AM
Subject: Re: signum


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.

The KISS principle is worthy of more attention.
An IF construct is more obvious.

 I have occasionally gotten
flamboyant and coded such as:

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

You have to be joking.

   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.

You can't avoid branches, either implicit or explicit.

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?

Conversion from boolean to integer is readily available in PL/I.

Reply via email to