comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Dispatch on the result still does not work?
Date: Mon, 13 Jul 2009 11:46:54 -0700 (PDT)
Date: 2009-07-13T11:46:54-07:00	[thread overview]
Message-ID: <c3e9743d-12e0-4a2c-ba12-4d408f7a444e@p18g2000pra.googlegroups.com> (raw)
In-Reply-To: 9f845311-63a4-4d89-ac78-b6567b999417@d4g2000prc.googlegroups.com

On Jul 13, 8:13 am, Adam Beneschan <a...@irvine.com> wrote:
> I think this also works:
>
>      X : T'Class := S'(Value);
>   begin
>      declare
>         function T_Value return T renames Pak1.Value;
>      begin
>         X := T_Value;
>      end;
>
> Again, the rename helps the compiler determine unambiguously which
> Value subprogram is intended, but it doesn't change the fact that the
> call to it is tag-indeterminate.  I'd need to pore over the rules more
> closely to make sure of this, however.

OK, I think I got this part wrong.  The AARM says that whether a call
on a subprogram rename is a dispatching operation depends on where the
renaming operation is declared, not on what it renames; here, the
rename is not a primitive subprogram (even though the thing it renames
*is* primitive), so the call on T_Value is not a dispatching operation
and thus can't be tag-indeterminate, and therefore the assignment
statement is illegal.  GNAT might be getting this wrong.

                                  -- Adam


>
> Anyway, the important thing to remember is that the compiler first has
> to determine which declaration is meant by every identifier in a
> statement, and only *then* can it think about whether a call is
> dispatching or not.
>
> Hope this helps,
>
>                                        -- Adam- Hide quoted text -
>
> - Show quoted text -




      parent reply	other threads:[~2009-07-13 18:46 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-11 10:04 Dispatch on the result still does not work? Dmitry A. Kazakov
2009-07-11 11:09 ` Chris Moore
2009-07-11 12:05   ` Dmitry A. Kazakov
2009-07-11 17:50     ` Chris Moore
2009-07-11 19:22       ` Dmitry A. Kazakov
2009-07-11 11:32 ` Hibou57 (Yannick Duchêne)
2009-07-11 12:20   ` Dmitry A. Kazakov
2009-07-11 13:36     ` Hibou57 (Yannick Duchêne)
2009-07-11 13:39       ` Hibou57 (Yannick Duchêne)
2009-07-11 15:19       ` Dmitry A. Kazakov
2009-07-11 18:08         ` Hibou57 (Yannick Duchêne)
2009-07-11 19:29           ` Dmitry A. Kazakov
2009-07-11 23:22             ` Hibou57 (Yannick Duchêne)
2009-07-12  9:46               ` Dmitry A. Kazakov
2009-07-11 18:54 ` Georg Bauhaus
2009-07-11 19:40   ` Dmitry A. Kazakov
2009-07-12 10:40     ` Chris Moore
2009-07-12 11:30       ` Dmitry A. Kazakov
2009-07-12 16:05         ` Chris Moore
2009-07-12 16:38           ` Dmitry A. Kazakov
2009-07-12 17:11             ` AdaMagica
2009-07-12 20:30               ` sjw
2009-07-13 16:55                 ` Adam Beneschan
2009-07-13 21:47                   ` sjw
2009-07-13 22:50                     ` Adam Beneschan
2009-07-14 21:06                       ` sjw
2009-07-13 15:13 ` Adam Beneschan
2009-07-13 15:17   ` Adam Beneschan
2009-07-13 16:33     ` AdaMagica
2009-07-13 18:46   ` Adam Beneschan [this message]
replies disabled

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