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,60fe876e7675f11 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.213.68 with SMTP id nq4mr14833032pbc.2.1328640854451; Tue, 07 Feb 2012 10:54:14 -0800 (PST) Path: lh20ni271423pbb.0!nntp.google.com!news2.google.com!postnews.google.com!k28g2000yqn.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Weird behavior with modular type Date: Tue, 7 Feb 2012 10:40:17 -0800 (PST) Organization: http://groups.google.com Message-ID: <2de5a8e2-10e7-4c4b-8997-d8546561b2b9@k28g2000yqn.googlegroups.com> References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 X-Trace: posting.google.com 1328640854 27233 127.0.0.1 (7 Feb 2012 18:54:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 7 Feb 2012 18:54:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k28g2000yqn.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: ARLUEHNKC X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-02-07T10:40:17-08:00 List-Id: On Feb 7, 10:35 am, Yannick Duch=EAne (Hibou57) wrote: > Le Tue, 07 Feb 2012 19:15:27 +0100, Adam Beneschan a > =E9crit: > > > In the first example, [...] Anyway, > > this means that in 10**I, the type of 10 is the modular type > > Modular_Type > > Why? "I" is a subtype of Natural, so 10**I should be too. Please reread what I wrote about "**". It is not like other operators. Its right operand is always Integer (of which Natural is a subtype). Therefore, knowing that I is an integer is *not* enough to determine the type of the left operand. The type of 10, and the type of 10**I, cannot be determined until you look at the larger context, which means that this: > Things look like > if the left-hand side of "<" has a consequence on the interpretation of > its right-hand side. is exactly correct. The compiler can't determine the type of 10 or 10**I until it sees the left-hand side of "<". -- Adam