Skip to content

Proposal: Split eval output #133

@acook

Description

@acook

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:

println!("\x1b[31mHello World!"); 5 + 5

Then the output is all red until the next In: prompt.

Values cannot be formatted differently than the printed out

print!("foo")

Outputs:

out: foo()

But a better format might be:

foo
result: ()

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions