-
Notifications
You must be signed in to change notification settings - Fork 34
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
Proposal: Split eval output #133
Comments
Hello, thanks your interest Unfortunately, to do this we need to analyze the code provided by the user, which is not possible currently since we're just sticking the code in a binary and running it A workaround is to write a plugin, that looks for print statements in the code , and put them last as you described, this won't work in all cases that's why it belongs into the plugins not in the main binary |
Hmm. I assumed it would be possible to not change the user's code at all, except for the final line, which I assume is already happening in order to print the output. Something like this:
But I took a look at the code and it is quite different from the other compiled-language REPLs I've played with, so I am probably missing something. |
If you have an example of a compiled language repl that does this I can take a look at it to see if there's something I can do here |
If we split the printed output from the value output when the program is run it would allow the return value to be distinct from any online output and format them independently.
Issues
Colors from print bleed into results
Given:
Then the output is all red until the next
In:
prompt.Values cannot be formatted differently than the printed out
Outputs:
But a better format might be:
This would bring IRust closer in line with other REPL formatting.
Solutions
Since we already need to capture the output to display it anyway, it should be simple enough to send the return value to a different location, such as a separate pipe, or after a simple delimiter.
Delimiter
Before the value is printed, include a simple delimiter. Even just
---
and then split the text at the last one.Pipe
Send the value to a pipe that the parent program watches.
The text was updated successfully, but these errors were encountered: