comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Weird behavior with modular type
Date: Tue, 7 Feb 2012 10:40:17 -0800 (PST)
Date: 2012-02-07T10:40:17-08:00	[thread overview]
Message-ID: <2de5a8e2-10e7-4c4b-8997-d8546561b2b9@k28g2000yqn.googlegroups.com> (raw)
In-Reply-To: op.v9bm8nt4ule2fv@douda-yannick

On Feb 7, 10:35 am, Yannick Duchêne (Hibou57)
<yannick_duch...@yahoo.fr> wrote:
> Le Tue, 07 Feb 2012 19:15:27 +0100, Adam Beneschan <a...@irvine.com> a
> écrit:
>
> > 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





  reply	other threads:[~2012-02-07 18:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-07 17:24 Weird behavior with modular type Yannick Duchêne (Hibou57)
2012-02-07 17:49 ` Jeffrey Carter
2012-02-07 18:06   ` Adam Beneschan
2012-02-07 18:21     ` Yannick Duchêne (Hibou57)
2012-02-08  6:53       ` J-P. Rosen
2012-02-08 15:29         ` Adam Beneschan
2012-02-09  3:37       ` Randy Brukardt
2012-02-07 18:15   ` Yannick Duchêne (Hibou57)
2012-02-07 17:53 ` Adam Beneschan
2012-02-07 17:54 ` Gautier write-only
2012-02-07 18:23   ` Yannick Duchêne (Hibou57)
2012-02-09  3:40     ` Randy Brukardt
2012-02-07 18:02 ` Adam Beneschan
2012-02-07 18:32   ` Georg Bauhaus
2012-02-07 18:13 ` Yannick Duchêne (Hibou57)
2012-02-07 18:15 ` Adam Beneschan
2012-02-07 18:35   ` Yannick Duchêne (Hibou57)
2012-02-07 18:40     ` Adam Beneschan [this message]
2012-02-07 19:22       ` Yannick Duchêne (Hibou57)
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox