ranges
Chris Torek
chris at umcp-cs.UUCP
Mon Jun 2 16:57:19 AEST 1986
In article <393 at peregrine.UUCP> mike at peregrine.UUCP (Mike Wexler) writes:
>[...] Another feature I would like to have is a range data type. I don't
>know of a good syntax for putting this in C but it would be nice to
>use in programs where are know the possible values of a number but
>would like the compiler to figure out an efficient sized slot to put
>it in.
Actually, I know of two uses for range types. You have stated one;
the other is to catch errors where a variable should never take on
values outside certain range(s). Pascal ranges seem sometimes to
serve one purpose, sometimes another; and the Berkeley Pascal
compiler includes runtime range checking iff one compiles with
`-C'. Were I designing a language with ranges, I think I would
separate the two uses.
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516)
UUCP: seismo!umcp-cs!chris
CSNet: chris at umcp-cs ARPA: chris at mimsy.umd.edu
More information about the Comp.lang.c
mailing list