Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!alberta!ubc-vision!ubc-cs!ludemann From: ludemann@ubc-cs.UUCP (Peter Ludemann) Newsgroups: net.lang.c Subject: Re: boolean datatype Message-ID: <274@ubc-cs.UUCP> Date: Wed, 11-Jun-86 22:31:15 EDT Article-I.D.: ubc-cs.274 Posted: Wed Jun 11 22:31:15 1986 Date-Received: Sun, 15-Jun-86 03:15:48 EDT References: <5498@alice.uUCp> <1462@mmintl.UUCP> <852@bentley.UUCP> Reply-To: ludemann@ubc-cs.UUCP (Peter Ludemann) Distribution: net Organization: UBC Department of Computer Science, Vancouver, B.C., Canada Lines: 23 In article <399@peregrine.UUCP> mike@peregrine.UUCP (Mike Wexler) writes: >In article <705@wjvax.wjvax.UUCP> brett@wjvax.UUCP (Brett Galloway) writes: >>In article <393@peregrine.UUCP> mike@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.)