Fast flattening of nested streams
Abstract
Techniques and tools are described for flattening nested streams. For example, a stream flattening tool processes nested streams on a stack to traverse the nested streams. The tool produces a flattened stream that enumerates the elements of the nested streams. In one embodiment, the tool initially pushes a stack frame onto the stack for a stream representing all of the nested streams. As the tool iterates across the “active” stream having the frame on the top of the stack, the tool may encounter and produce elements in the “active” stream. Or, the tool may encounter a nested stream and push a stack frame for the nested stream onto the stack, then continuing by iterating across the new active stream. The tool pops the stack frame for the active stream from the stack when the end of the stream is reached, or potentially earlier if handling a nested tail stream.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 5 · Forward citations: 12.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
A computer-readable storage medium storing computer-executable instructions for causing a computer system programmed thereby to perform a method comprising: receiving source code, wherein the source code comprises an iterator method for incrementally computing and yielding a sequence of values, the iterator method comprising a yield statement, the yield statement returning a recursive call to the iterator method; and compiling the source code, wherein: the compiling produces enumerator instructions for processing a plurality of nested streams on a stack to produce an unnested stream, the plura
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗
Cited By — Indexed Forward Citations (12 of 12 total)
References Cited — Backward Prior Art (5)
Non-Patent Literature (5)
- "Lazy evaluation," Wikipedia, 4 pages, Retrieved Mar. 24, 2009, from .
- "Lazy evaluation," Wikipedia, 4 pages, Retrieved Mar. 24, 2009, from <http://en.wikipedia.org/wiki/Lazy—evaluation>.
- "Standard streams," Wikipedia, 5 pages, Retrieved Mar. 24, 2009, from .
- "Standard streams," Wikipedia, 5 pages, Retrieved Mar. 24, 2009, from <http://en.wikipedia.org/wiki/Standard—streams>.
- "Stream (computing)0," Wikipedia, 1 page, Retrieved Mar. 24, 2009, from .