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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,df40d0d1975a16a6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-13 08:13:46 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!213.200.246.247!not-for-mail From: Vinzent Hoefler Newsgroups: comp.lang.ada Subject: Re: Optimizing Boundary Checks Date: Fri, 13 Jun 2003 17:12:15 +0200 Organization: JeLlyFish software Message-ID: References: NNTP-Posting-Host: 213.200.246.247 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: fu-berlin.de 1055517224 18629212 213.200.246.247 (16 [175126]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:39123 Date: 2003-06-13T17:12:15+02:00 List-Id: Martin Dowie wrote: >"Vinzent Hoefler" wrote in message >news:bcckq8$i67ah$1@ID-175126.news.dfncis.de... >> > for I in My_Array'Range loop >[snip] >> This I find interesting. (Of course, assuming that My_Type is the >> Index type of My_Array). > >Yes it is. I've always tended to use this form anyway, as it >copes with the (unlikely) case where the index type changing or >(even more unlikely case of) the array type changing! Yes, and finding this *very* useful, it reminds me, I would like to have this feature for *every* variable, not just for arrays: As an example, currently |x : My_Enum; | |for i in x'Range loop ... doesn't work, you have to write |for in in My_Enum'Range loop each time. Is there any convincing explanation why it isn't allowed to use the actual type of a variable instead of the type itself? I can imagine situations (especially with subtypes) where it could be handy to use the variables' type instead of an explicit type specification. Vinzent. --=20 Parents strongly cautioned -- this posting is intended for mature audiences over 18. It may contain some material that many parents would not find suitable for children and may include intense violence, sexual situations, coarse language and suggestive dialogue.