forked from racket/racket
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple values in stream-cons + use stream-cons in stream op…
…erations The stream protocol and stream operations support multiple values. However, stream-cons does not. The consequences are: - Multiple values in streams can't be easily used by users. - Internal stream operations are implemented in a convoluted way to support multiple values, which is error-prone. There are many mistakes in the current implementation, including but not limited to: - Incorrect laziness - Linear time memory consumption on operations that should take constant time See https://racket.discourse.group/t/stream-filter-not-in-constant-space/1643 for the discussion. This commit adds a support of multiple values to stream-cons. We then utilize this stream-cons on the stream operations to fix the issues mentioned above. Note that there are still known deficiencies in the current implementation. These deficiencies are not degradation, however, because SRFI-41 also has them. Furthermore, the data definition of streams in Racket makes it difficult to fix these deficiencies without a large refactoring, so I would like to postpone fixing these issues to the next PRs. See https://srfi-email.schemers.org/srfi-41/msg/21844204/ for the discussion.
Showing
5 changed files
with
278 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.