boolean datatype

Peter Ludemann ludemann at ubc-cs.UUCP
Thu Jun 12 12:31:15 AEST 1986


In article <399 at peregrine.UUCP> mike at peregrine.UUCP (Mike Wexler) writes:
>In article <705 at wjvax.wjvax.UUCP> brett at wjvax.UUCP (Brett Galloway) writes:
>>In article <393 at peregrine.UUCP> mike at peregrine.UUCP (Mike Wexler) writes:

>>I would prefer an operator that merely generated an integral type based on
>>a number of bits requested, not based on a desired range.  For example,
>>on a machine with 8-bit char, 16-bit short, 32-bit int, and 64-bit long,
>>bittype(8) == char; bittype(9) == short; bittype(31) == int; and so on.
>
>It also puts the burden on the user to figure out how many bits are needed
>to store a particular number.  This could lead to either less efficient code
>or nonportable code due to problems with signed/unsigned variables.  

WSL (Waterloo Systems Language) has what you want.  It's basically a 
tidied up version of C.  The syntax is like Pascal, but no range 
checking is actually done.  So "i:1..10" would be C's "char i"; while 
"i:0..1000" would be C's "unsigned short int i".  

A commercial data centre evalutated WSL and probably would have used 
it except for the detail that there existed no WSL->C and C->WSL 
translators.  But the implementation looked quite good.  For more 
info, contact WatSoft at the University of Waterloo, Waterloo, 
Ontario, Canada.  (The book is available separately.) 



More information about the Comp.lang.c mailing list