Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow I/O operations to have a level of indirection. #123

Merged
merged 3 commits into from
Jan 25, 2023
Merged

Conversation

skx
Copy link
Owner

@skx skx commented Jan 25, 2023

This pull-request supersedes #121, which was never merged, as a solution to embedding the interpreter and allowing flexible I/O handling:

  • Rather than changing our builtin-signatures we introduce a new config/ package.
  • We pass an instance of the configuration object, containing handles, to the interpreter.
  • This is then accessed to read/write to STDIN/STDOUT.

The test-case for (print), TestPrint, was updated to send output to a faux I/O helper - which is actually a buffer - and shows that the indirection works.

And now that we've implemented the I/O helper we've updated (read) to use it appropriately too.

This pull-request supersedes #121, which was never merged, as a
solution to embedding the interpreter and allowing flexible I/O
handling:

* Rather than changing our builtin-signatures we introduce a new
  config/ package.
* We pass an instance of the configuration object, containing handles,
  to the interpreter.
* This is then accessed to read/write to STDIN/STDOUT.

The test-case for (print), TestPrint, was updated to send output
to a faux I/O helper - which is actually a buffer - and shows that
the indirection works.

And now that we've implemented the I/O helper we've updated (read)
to use it appropriately too.
@skx skx self-assigned this Jan 25, 2023
@skx skx merged commit 97d7c80 into master Jan 25, 2023
@skx skx deleted the io-indirection branch January 25, 2023 18:22
@skx skx mentioned this pull request Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant