odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.1k stars 550 forks source link

Added fmt.ctprint #3807

Closed karl-zylinski closed 6 days ago

karl-zylinski commented 6 days ago

There is a fmt.tprint but no fmt.ctprint, so I added it.

Kelimion commented 6 days ago

There's something bothering me about the procedure's description that it shares with fmt.print, fmt.tprint, etc, in that it's stated to format the arguments, but takes no format string.

Separating the incoming arguments with a user-definable separator stretches the definition of formatting for me.

Maybe - and I consider this outside the scope of this PR - we should literally just say that: "Separates the arguments with a user-defined separator (space by default) and ...", where ... is "and prints the result to stdout" or "and returns this as a cstring", as appropriate.

karl-zylinski commented 6 days ago

@Kelimion maybe it's also because you can send in a value of any type as arg that someone thought of it as "formatting". But I agree, I found it a bit confusing too.

Kelimion commented 6 days ago

That's a good point.