From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1901f265c928a511 X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!spamkiller2.gnilink.net!gnilink.net!nwrdny03.gnilink.net.POSTED!0e8a908a!not-for-mail From: Hyman Rosen User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Typing in Ada References: <2i1t1lFij4g5U1@uni-berlin.de> In-Reply-To: <2i1t1lFij4g5U1@uni-berlin.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <9ZRuc.8410$hB2.7017@nwrdny03.gnilink.net> Date: Tue, 01 Jun 2004 02:36:53 GMT NNTP-Posting-Host: 68.161.84.198 X-Complaints-To: abuse@verizon.net X-Trace: nwrdny03.gnilink.net 1086057413 68.161.84.198 (Mon, 31 May 2004 22:36:53 EDT) NNTP-Posting-Date: Mon, 31 May 2004 22:36:53 EDT Xref: controlnews3.google.com comp.lang.ada:975 Date: 2004-06-01T02:36:53+00:00 List-Id: Nick Roberts wrote: > That is to say that in most Ada > programs it is typical to have constructions such as: > type Apples is range 0..100; > type Oranges is range 0..200; Is it really? The very fact that you have named these types as you did suggests that the appplicability of ranged types is quite limited. In a real program that does something useful, what kinds of things do you want to count up to 100 but not to 101? To 200 but not to 201? Can you give examples from some of your real code? > In either case, in Ada, the easy mistake: > A := O; > will be caught by the compiler, whereas in either of the C constructions: > a = o; > will not. I think it's more likely that a type with a limited number of values would be represented as an enumeration, in which case the errant construct would be caught by C as well.