Question about IO.println

David Alayachew davidalayachew at gmail.com
Tue Mar 4 13:03:55 UTC 2025


Hello Amber Dev Team and Core Libs Dev Team,

Another reddit discussion popped up today about IO.println(), and one of
the comments mentioned that they wanted something along the lines of this.

IO.println(num1, num2, num3); //prints out "1 2 3"

I proposed that maybe a better option would be a String.join overload. So,
instead of String.join(String delim, String... elements), there would be
String.join(String delim, Object... elements), with each object getting
toString() called on it.

What are your thoughts on either of these ideas? I actually think the
IO.println() version is nice, but I felt like String.join made a slightly
better compromise.

Another commentor mentioned that this will be easier with String Templates
too, so maybe it is better to wait for that. I don't think String templates
are a bad idea here, but it also felt like overkill imo. A library function
seems like a better fit.

Thank you for your time and thoughts.
David Alayachew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20250304/5ff5dae4/attachment.htm>


More information about the amber-dev mailing list