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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f71c159449d6e114 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Ada 83 - avoiding unchecked conversions. Date: 1996/12/14 Message-ID: #1/1 X-Deja-AN: 204164096 references: <32B062D3.7E9A@ccgate.hac.com> <32B17F46.123B@gsfc.nasa.gov> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-12-14T00:00:00+00:00 List-Id: In article <32B17F46.123B@gsfc.nasa.gov>, Stephen Leake wrote: >Perhaps there should have been a type "Fast_Integer", with the >understanding that it was at least 16 bits (this is of course just >Standard.Integer). Then programmers can use Fast_Integer when they don't >really care about the size. Sometimes, you want "an integer of at least so-and-so range, but I don't mind if it has more range, so long as it doesn't cost me any efficiency". To say that in Ada 95: type Specific_Range is range -10_000..10_000; subtype T is Specific_Range'Base; Then use T all over. Other times, you want an integer type that has something to do with the amount of addressable memory on the machine. E.g. type String, where the index type is Integer, and one presumes that Integer is 16 bits on a 16-bit machine, and 32 bits on a 32-bit machine -- that makes sense, since you won't want to create 10 megabyte strings on the 16-bit machine, but you might on the 32-bit machine. - Bob