modes Book and Channel and binary vs character transput: a proposal

Mohammad-Reza Nabipoor mnabipoor@gnu.org
Sat Jan 10 04:31:04 GMT 2026


Hi Chris.

On Fri, Jan 09, 2026 at 07:52:25PM -0800, chris hermansen wrote:
> >
> > Hmm, if we have:
> >
> >   mode Byte = short short int;
> >   Byte b;
> >
> > then
> >
> >   `BIN b' yields is a `short short int' with a value between 0 and 255.
> >
> 
> Really?  I thought short short int would be -128..127; is it not signed?
> 


`BIN b' is a typo, it's actually `ABS b'. And yes, -128..127 is correct; all integers
in Algol 68 are signed. There's no unsigned integers as they are not integers, they're
just a sequence of bits and their mode is `bits'.

Example particular-program:

(short short bits ssb = short short 16r80;
 short short int ssi = ABS ssb;

 assert (ssi = SHORTEN SHORTEN -128))


Regards,
Mohammad-Reza


More information about the Algol68 mailing list