What are the last two items in a stream?

The two falses of this:

Internal implementation detail
untitled script pic - 2021-12-19T203639.343

The way streams work is that only the first item is computed right away; others are computed only as needed, i.e., when you say TAIL OF STREAM.

But if you traverse the same stream repeatedly, you don't want to re-compute the items. So the stream is memoized [sic]: Each piece of the stream remembers whether its second (function) item has been invoked, and if so, what value was reported.

So, the third item of the list is a Boolean value that's True if the second item has been called, False otherwise. The fourth item is the reported value if the third item is True; its initial False value is just a convenience that doesn't matter because the implementation looks at the fourth item only if the third item is True.

No need for that, unless it's for other people to see and know that's how it's spelled

Ah. (I bet I could modify the BYOB streams example to implement that.)

Well, it's one letter away from a more widely known word with a related meaning, so it looks like a typo.



This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.