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,4ff929aa5c2b2834 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news1.google.com!news.maxwell.syr.edu!kanaga.switch.ch!news-zh.switch.ch!switch.ch!cernne03.cern.ch!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Ranges and (non)static constraints Date: Thu, 16 Nov 2006 14:23:01 +0100 Organization: CERN News Message-ID: References: <1163679831.668031.123360@h54g2000cwb.googlegroups.com> NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: cernne03.cern.ch 1163683381 24574 137.138.37.241 (16 Nov 2006 13:23:01 GMT) X-Complaints-To: news@@cern.ch NNTP-Posting-Date: Thu, 16 Nov 2006 13:23:01 +0000 (UTC) User-Agent: Thunderbird 1.5.0.8 (X11/20061113) In-Reply-To: <1163679831.668031.123360@h54g2000cwb.googlegroups.com> Xref: g2news2.google.com comp.lang.ada:7502 Date: 2006-11-16T14:23:01+01:00 List-Id: Martin Krischik wrote: > > On 16 Nov., 12:02, Maciej Sobczak wrote: >> Hi, >> >> type T is range 1 .. N; >> type U is new Integer range 1 .. M; >> >> N must be static, but M does not have to. >> Why and what is the real difference between T and U? > > Let me answer with a question: What value has T'Size? Whatever the compiler picks to fit the given range? :-) OK, now I see - but is there any preference I should give to one of these two forms apart from that? I understand that the second form is the only I can use if the range is not statically known and (what surprised me) when the constraints come from formal generic parameters. But even if the range is known statically, I might choose to always use the second form for notational consistency. Is this recommended? Assuming that T'Size = U'Size, can I expect any run-time observable (including performance) differences between T and U? -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/