comp.lang.ada
 help / color / mirror / Atom feed
From: Jeff Carter <jrcarter001@my-deja.com>
Subject: Re: Instantiating a generic formal procedure with an access procedure value
Date: 2000/01/12
Date: 2000-01-12T00:00:00+00:00	[thread overview]
Message-ID: <85ifd2$bae$1@nnrp1.deja.com> (raw)
In-Reply-To: 84u97t$uut$1@nnrp1.deja.com

This issue is still unresolved. We know that Tucker Taft's favorite
front end accepts this code, but that GNAT 3.11p does not.

In cases such as this, I have learned to expect a posting from Robert
Dewar pointing out that 3.11 has been replaced by 3.12, often with a
statement that 3.12p handles this correctly. However, that has not
happened for this.

I would like to know how GNAT 3.12 handles this case. It would take
over an hour for me to download 3.12p, and I am not able to do so now.
I would appreciate hearing from anyone with 3.12 what results it gives
on this code.

If GNAT 3.12 continues to reject this, which is correct?

In article <84u97t$uut$1@nnrp1.deja.com>,
  Jeff Carter <jrcarter001@my-deja.com> wrote:
> In article <38725A42.2961CEFC@averstar.com>,
>   Tucker Taft <stt@averstar.com> wrote:
> > Your code compiles fine with My Favorite Front End.
>
> I'm glad to hear that.
>
> >
> > This looks like a good old compiler bug.  On the other hand,
> > it would still help if you included the complete source code,
> > exactly as it was submitted to GNAT.  For example, I am surprised
> > GNAT didn't complain about lack of a generic body.
>
> Here's everything, copied and pasted from the actual files submitted
to
> GNAT:
>
> package S_U is
>    type Handle is limited private;
>
>    procedure Op (Item : in out Handle; Element : in Integer);
>
>    generic -- Iterate
>       with procedure Action (Element : in out Integer; Continue : out
> Boolean);
>    procedure Iterate (Over : in out Handle);
> private -- S_U
>    type Handle is new Integer;
> end S_U;
>
> package body S_U is
>    procedure Op (Item : in out Handle; Element : in Integer) is
>    begin -- Op
>       null;
>    end Op;
>
>    procedure Iterate (Over : in out Handle) is
>       Continue : Boolean;
>    begin -- Iterate
>       Action (Element => Integer (Over), Continue => Continue);
>    end Iterate;
> end S_U;
>
> with S_U;
> package S is
>    type Action_Ptr is access procedure (Element : in out Integer;
> Continue : out Boolean);
>
>    protected type Handle is
>       procedure Op (Element : in Integer);
>       procedure Iterate (Action : in Action_Ptr);
>    private -- Handle
>       Data : S_U.Handle;
>    end Handle;
> end S;
>
> package body S is
>    protected body Handle is
>       procedure Op (Element : in Integer) is
>       begin -- Op
>          S_U.Op (Item => Data, Element => Element);
>       end Op;
>
>       procedure Iterate (Action : in Action_Ptr) is
>          procedure Local is new S_U.Iterate (Action => Action.all);
>       begin -- Iterate
>          Local (Over => Data);
>       end Iterate;
>    end Handle;
> end S;
>
> I hope that helps.
>
> --
> Jeff Carter
> "Now go away or I shall taunt you a second time."
> -- Monty Python and the Holy Grail
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

--
Jeff Carter
"Now go away or I shall taunt you a second time."
-- Monty Python and the Holy Grail


Sent via Deja.com http://www.deja.com/
Before you buy.




  parent reply	other threads:[~2000-01-12  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-31  0:00 Instantiating a generic formal procedure with an access procedure value Jeff Carter
2000-01-03  0:00 ` Tucker Taft
2000-01-04  0:00   ` Jeff Carter
2000-01-04  0:00     ` Tucker Taft
2000-01-05  0:00       ` Jeff Carter
2000-01-05  0:00         ` Ed Falis
2000-01-12  0:00         ` Jeff Carter [this message]
2000-01-12  0:00           ` Simon Wright
2000-01-13  0:00             ` Jeff Carter
2000-01-13  0:00               ` Tucker Taft
2000-01-14  0:00                 ` Jeff Carter
2000-01-13  0:00               ` Simon Wright
replies disabled

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