Bug 301984 - [backend] Make Iterator System functions lazy
Summary: [backend] Make Iterator System functions lazy
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: b3 (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2010-02-05 11:48 EST by Henrik Lindberg CLA
Modified: 2017-09-13 11:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Lindberg CLA 2010-02-05 11:48:55 EST
The current set of iterator functions (select, reject, exists, etc.) returns lists instead of iterators - for some of the operations that is not the most optimal (producing a very long list when the first element satisfies the outer function.

Seen from the outermost perspective, user would probably not want the result to be an iterator. Several solutions are possible (like auto conversion  of an iterator to a list if assigning the result to a List variable, or sending it as a parameter to a function that takes a list. 

With smart typecasting - i.e. List(anIterator) could also be a solution resulting in a List<E> from List(anIterator<E>).