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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a0be06fbc0dd71f1 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "(see below)" Newsgroups: comp.lang.ada Subject: Re: The future of Ada is at risk Date: Sun, 13 Jan 2008 14:05:53 +0000 Message-ID: References: <20071229040639.f753f982.coolzone@it.dk> <13oe680qard6u2d@corp.supernews.com> <47887709.9030107@obry.net> <47889568.3010507@obry.net> <4789038F.7090708@obry.net> <1200176645.8909.4.camel@K72> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: individual.net ggz/g9qkx1HDyq/jtU6uHQv8l3j4xJTpHA3tCRvMyNMoZUD+v+ Cancel-Lock: sha1:rTIQqH05WBfz2okIb1j2y+lQ13g= User-Agent: Microsoft-Entourage/11.3.6.070618 Thread-Topic: The future of Ada is at risk Thread-Index: AchV7WiQpzPzEMHgEdyDDAARJIjQTg== Xref: g2news1.google.com comp.lang.ada:19385 Date: 2008-01-13T14:05:53+00:00 List-Id: On 13/1/08 03:54, in article ulk6uxtw7.fsf@STRIPCAPStelus.net, "Ray Blaak" wrote: > In fact, since I have left the Ada camp, I have never felt the need to have a > constrained integer type (well, beyond Positive or Natural). I have however, > felt the need to have the compiler prevent accidental mixups between a "count > of widgets" and a "count of wingbats". Selecting just the integer ranges from some of my code, and ignoring the float, character, and enumeration ranges, I find the following: subtype a_logger_list_size is Natural range 0..max_logger_list_size; subtype a_positive_unsigned is an_unsigned range 1 .. an_unsigned'Last; type a_lock_set_index is new Natural range 0..lock_set_size-1; subtype nat_integral is integral range 0 .. integral'Last; subtype pos_integral is integral range 1 .. integral'Last; subtype moebius_integral is integral range -1 .. +1; type long_integer is range -2**31 .. + 2**31 - 1; subtype generic_nat is generic_int range 0..generic_int'Last; subtype generic_pos is generic_int range 1..generic_int'Last; subtype rat_nat is rat_int range 0 .. rat_int'Last; subtype rat_pos is rat_int range +1 .. rat_int'Last; subtype int_nat is int_int range 0 .. int_int'Last; subtype int_pos is int_int range +1 .. int_int'Last; type an_internal_integer is range -2**63 .. +2**63-1; subtype line_size is Natural range 0..line_size_maximum; subtype creat_mode is i64 range 0 .. 8#777#; subtype open_mode is i64 range 0 .. 1; subtype seek_whence is i64 range 0 .. 2; subtype an_alignment_mask is a_virtual_address range 0..7; buffer_count : Natural range 0 .. retro_buffer_size := 0; type a_signed_long is range -2**63 .. +2**63 - 1; type a_signed_word is range -2**31..+2**31 - 1; type a_signed_half is range -2**15..+2**15 - 1; type a_signed_byte is range -2**7..+2**7 - 1; subtype a_word_number is a_virtual_address range 0 .. RAM_size/4 - 1; subtype i02 is i04 range 0..3; subtype a_size_code is i04 range B_mode..L_mode; Many of these are what might be called bounded Natural or bounded Positive; several are dependent on a generic type or in parameter, although none are dynamic in another way. I assert that, in context, these are the natural and necessary ways to achieve my software engineering objectives. You'll have to trust me on that. 8-) -- Bill Findlay chez blueyonder.co.uk