roc icon indicating copy to clipboard operation
roc copied to clipboard

Syntactically invalid REPL output when answer is multiline string

Open rtfeldman opened this issue 3 years ago • 0 comments

Here's what happens if I put "foo\nbar" into the REPL:

» "foo\nbar"

"foo
bar" : Str

That answer is syntactically invalid!

Instead, whenever we're about to print a string literal containing one or more newline characters, we should print it with triple-quoted strings, like so:

» "foo\nbar"

"""
foo
bar
""" : Str

rtfeldman avatar Aug 14 '22 20:08 rtfeldman