comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Generalized Iterators
Date: Tue, 29 Dec 2015 16:12:59 -0600
Date: 2015-12-29T16:12:59-06:00	[thread overview]
Message-ID: <n5v0hc$6tq$1@loke.gir.dk> (raw)
In-Reply-To: aea9159f-c02c-4a08-915a-504227424bd9@googlegroups.com

"AdaMagica" <christ-usch.grein@t-online.de> wrote in message 
news:aea9159f-c02c-4a08-915a-504227424bd9@googlegroups.com...
> I'm experiencing problems with generalized iterators. The code below is 
> reduced
> to the minimum in order to be compilable and show the problem. Note that 
> the
> body of Circularly_Linked_Lists is not given since not needed to produce 
> the
> problem.
>
> The code follows strictly the examples given in the Ada 2012 Rationale.
> Expecially the function Iterate is defined thus:
>
>  function Iterate (CLL: not null access Circularly_Linked_List)
>    return Forward_Iterator'Class;
>
> This produces the compiler message (GNAT GPL 2015)
>
>  for Cursor in List.Iterate loop
> ausprobieren.adb:15:21: expect object that implements iterator interface
>
...
I get the same result with the compiler I have. (It's probably newer than 
GPL 2015, but I'm not certain as it is a wavefront for a problem last year.)

...
> I can understand this since Iterate has the list as an access parameter,
> and the compiler tries to construct the "in" loop from the default 
> iterator.
> But also this does not work:
>
>  for Int of List'Access loop
>
> Is this a problem of GNAT or is there anything I just don't see?

Looks like a problem of GNAT. Didn't we discuss something like this example 
within the last few months here??

                                    Randy.


  reply	other threads:[~2015-12-29 22:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-29 11:50 Generalized Iterators AdaMagica
2015-12-29 22:12 ` Randy Brukardt [this message]
2015-12-31 10:33   ` AdaMagica
2016-01-05  1:54 ` Lucretia
replies disabled

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