Closed sts10 closed 1 year ago
It might be nice to have the option for print not to insert a newline at the end.
print
For example, in Python, print takes an optional end-character, allowing user to overwrite the default newline:
print("hello, ", end='') print("world")
In Go, we get a slightly different method:
fmt.Printf("hello, ") fmt.Printf("world")
And similarly in Rust, a slightly different macro: print!("hello, ")
print!("hello, ")
Maybe a bit niche for so young a language, but it can be handy when using loops.
You can achieve this with prints. It's not currently emulated in the playground though, I should take a look at that...
prints
This should be working now in the playground.
It might be nice to have the option for
print
not to insert a newline at the end.For example, in Python,
print
takes an optional end-character, allowing user to overwrite the default newline:In Go, we get a slightly different method:
And similarly in Rust, a slightly different macro:
print!("hello, ")
Maybe a bit niche for so young a language, but it can be handy when using loops.