From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 12 Dec 91 03:17:49 GMT From: iWarp.intel.com|ichips!intelhf!agora!markb@uunet.uu.net (Mark Biggar) Subject: Re: 'SIZE attribute of a type Message-ID: <1991Dec12.031749.28929@agora.uucp> List-Id: In article <5898@email.sp.unisys.com> parkhill@email.sp.unisys.com (parkhill) w rites: >>parkhill@email.sp.unisys.com (parkhill) writes: >>>Image a compiler was smart enough to understand baised number ranges. >>> type b is range 9 .. 10; >>> or >>> type b is range 2**31 - 2 .. 2**31 - 1; >>>If the compiler can generate code that only uses 1 bit then b'Size >>>should return 1. >My point on the compiler having the capability to use one bit is that I >find the utility of type_name'size is now questionable. Lets say the >compiler is capable of using 1 bit but won't do it in most situations. >How can any programmer use type_name'size to any practical purpose? It >seems less useful than Entry_Name'Count. However, I am sure that the >justification for the change to type_name'size is rock solid. I don't thing anyone would implement this as an automatic feature of an Ada compiler. But, it is perfectly reasonable for the rep-clause for b'size use 1; to cause a compiler to do just what you want, while not having the rep-clause would make b'size something like 8, 16 or 32. b'size is the actual storage used for the type not the minimum possible. -- Mark Biggar markb@agora.rain.rain.com