Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.lang.c Subject: Re: ranges Message-ID: <1774@umcp-cs.UUCP> Date: Mon, 2-Jun-86 02:57:19 EDT Article-I.D.: umcp-cs.1774 Posted: Mon Jun 2 02:57:19 1986 Date-Received: Tue, 3-Jun-86 23:49:24 EDT References: <5498@alice.uUCp> <1462@mmintl.UUCP> <852@bentley.UUCP> <1126@whuxl.UUCP> <393@peregrine.UUCP> Reply-To: chris@maryland.UUCP (Chris Torek) Organization: University of Maryland, Dept. of Computer Sci. Lines: 18 In article <393@peregrine.UUCP> mike@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@umcp-cs ARPA: chris@mimsy.umd.edu