isaacg1 / pyth

Pyth, an extremely concise language. Try it here:
https://pyth.herokuapp.com/
MIT License
263 stars 57 forks source link

Newline is redundant #132

Closed Maltysen closed 9 years ago

Maltysen commented 9 years ago

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?

jakobkogler commented 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.

Maltysen commented 9 years ago

@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.

isaacg1 commented 9 years ago

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.

isaacg1 commented 9 years ago

Without any ideas for what to do on newline, I'm closing this.