Closed Maltysen closed 9 years ago
It allows creating strings with newlines in it. Instead of "a\nb"
, you
can write "a<newline>b"
. Saves on byte. But it's not used very often.
On Jul 24, 2015 10:24 PM, "Maltysen" notifications@github.com wrote:
The newline is meant to allow separation that does not suppress input by forcing print outside of a expression. Like 3\n4. However, the new print function makes this redundant because it always forces a print. So the above is equivalent to 3p4.
Any ideas what to do with newline?
— Reply to this email directly or view it on GitHub https://github.com/isaacg1/pyth/issues/132.
@jakobkogler Even if we change newline to be something else, that would still work since its inside a string. I'm talking about its use as an operator.
Those aren't actually equivalent - one has a trailing newline, the other doesn't. Compare: https://pyth.herokuapp.com/?code=3%0A4%5Ca&debug=0 and https://pyth.herokuapp.com/?code=3p4%5Ca&debug=0 That being said, we could probably find something more useful for it.
Without any ideas for what to do on newline, I'm closing this.
The newline is meant to allow separation that does not suppress input by forcing print outside of a expression. Like
3\n4
. However, the newp
rint function makes this redundant because it always forces a print. So the above is equivalent to3p4
.Any ideas what to do with newline?