Opened at 2009-10-17T14:59:48Z
Last modified at 2026-04-09T20:15:20Z
#349 accepted planned
IterAdapter improvements
| Reported by: | Ichthyostega | Owned by: | Ichthyostega |
|---|---|---|---|
| Priority: | nice | Milestone: | 2beta |
| Component: | lumieraSteam | Keywords: | QA cleanup lib |
| Sub Tickets: | #182, #353, #375, #390, #392, #393, #410, #874, #892, #1114 | Parent Tickets: | #283, #1420 |
Description
IterAdapter needs some more love....
Especially, the iteration control API seems misaligned.
- maybe we should better define the extension point through a free function (to be picked up by ADL)
- alternatively, we could shape the conrol API similar to Java's Iterator interface, i.e. hasNext() and next()
But before we can do any of these changes, we need more experiences with the use of the whole concept
Change history (18)
comment:1 by , at 2009-10-17T15:48:50Z
| blockedby: | 182 → 182, 353 |
|---|
comment:2 by , at 2009-10-23T20:18:35Z
| blockedby: | 182, 353 → 182, 353, 375 |
|---|
comment:3 by , at 2009-10-29T03:24:45Z
| Status: | new → accepted |
|---|
comment:4 by , at 2009-10-30T19:20:36Z
| blockedby: | 182, 353, 375 → 182, 353, 375, 390 |
|---|
comment:5 by , at 2009-10-31T23:01:01Z
| blockedby: | 182, 353, 375, 390 → 182, 353, 375, 390, 392 |
|---|
comment:6 by , at 2009-10-31T23:13:38Z
| blockedby: | 182, 353, 375, 390, 392 → 182, 353, 375, 390, 392, 393 |
|---|
comment:7 by , at 2009-11-01T00:59:42Z
| Owner: | removed |
|---|---|
| Status: | accepted → assigned |
comment:8 by , at 2009-11-12T20:45:32Z
| blocking: | → 283 |
|---|
comment:9 by , at 2009-11-12T20:48:52Z
| blockedby: | 182, 353, 375, 390, 392, 393 → 182, 353, 375, 390, 392, 393, 410 |
|---|
comment:10 by , at 2010-06-14T00:13:50Z
build quite some iterators meanwhile, but didn't settle down on a solution here... thus keeping this one open for now
comment:11 by , at 2010-10-23T04:03:18Z
| Owner: | set to |
|---|---|
| Status: | assigned → accepted |
| Type: | todo → planned |
now seems to be more mature, rather just requiring a bit of renaming and cleanup. Anyway, keeping this open but pushing to future -- still needing more practical experience with those iter adapters and itertools
comment:12 by , at 2011-12-18T00:59:34Z
| blockedby: | 182, 353, 375, 390, 392, 393, 410 → 182, 353, 375, 390, 392, 393, 410, 874 |
|---|
comment:13 by , at 2012-05-03T23:50:45Z
| blockedby: | 182, 353, 375, 390, 392, 393, 410, 874 → 182, 353, 375, 390, 392, 393, 410, 874, 892 |
|---|
comment:14 by , at 2017-10-29T10:37:29Z
meanwhile the problem is rather that we've gotten several families of iterator-implementations, each of which has its own implementation style and iteration control API. Most of them seem to settle on three free functions as extension points, and especially the API for IterStateWrapper turns out to be convenient and easy to implement. However, IterAdapter and the IterSource (virtual) interface got away with just two extension points. IterAdapter turned out to be very versatile -- but also hard to implement correct. Typically you'd have to read and understand the code in IterAdapter itself each and every time, which is unacceptable. An iteration control API should be clear and obvious enough to be just coded up at usage site
comment:15 by , at 2017-10-29T11:00:36Z
| blockedby: | 182, 353, 375, 390, 392, 393, 410, 874, 892 → 182, 353, 375, 390, 392, 393, 410, 874, 892, 1114 |
|---|
comment:16 by , at 2025-12-25T00:00:00Z
| blockedby: | 182, 353, 375, 390, 392, 393, 410, 874, 892, 1114 |
|---|---|
| blocking: | 283 |
| Parent Tickets: | → 283 |
| Sub Tickets: | → 182, 353, 375, 390, 392, 393, 410, 874, 892, 1114 |
Migration MasterTickets ⟼ Subtickets-plugin
comment:17 by , at 2026-04-07T16:02:10Z
During the last weeks, I did quite some clean-up and improvement work related to our iterator framework. It seems clear that usage converges towards some common ground
- most everyday usage relies on
IterExplorer, the pipeline builder, which is quite mature meanwhile - when specific processing is required, the State Core concept is the preferable way for implementation; it can be adapted easily to expose a Lumiera Forward Iterator
- on some rare yet relevant occasions, we need an completely abstracted or opaque iterator; this is when the
IterSourceframework is used.
Largely, the situation is satisfactory — yet the design could be improved: The internal interface expected by IterSource is designed clumsily and hard to understand and get right. It would be much more adequate to swap that out in favour of the State Core interface, which expects three functions, and these could be virtual functions in that case. On that occasion, also the very first implementation, the IterAdaptor should be replaced with a delegation to a State Core ⟹ #1125
However, another usage pattern is not addressed satisfactory yet: this is when we need to package an iterator as opaque value — similar to what was specified as »piggyback iterator« many years ago. In a contemporary programming framework, this would translate to the specification of a single iteration function that can then be packaged as an inline opaque functor ⟹ #130
comment:18 by , at 2026-04-07T17:58:38Z
| Parent Tickets: | 283 → 283, 1420 |
|---|
Attach to parent #1420 (Framework for Iteration and Lazy Processing).

due to the work on #353 (which was caused by the use within the QueryResolver), I need to change the iteration control API to free functions right away.