wren icon indicating copy to clipboard operation
wren copied to clipboard

String inside a sequence is quoted in toString method.

Open ThakeeNathees opened this issue 4 years ago • 2 comments

test.wren

var list = [42, 12, "42, 12", false, "false"]
System.print(list)

var map = {12: "List", "12": List}
System.print(map)

Before

[42, 12, 42, 12, false, false]
{12: List, 12: List}

After

[42, 12, "42, 12", false, "false"]
{12: "List", "12": List}

ThakeeNathees avatar May 20 '21 19:05 ThakeeNathees

For the content of this patch I have some concerns, as it tries to do an equivalent of python repr. Implementation wise, I would have preferred a String.quote, and make it part of join instead. But even with that In place I'm still wondering.

mhermier avatar May 20 '21 19:05 mhermier

My thumbs up was for the functionality itself. I think this improves the readability. The implementation could likely be improved further, agreed.

joshgoebel avatar May 20 '21 20:05 joshgoebel