Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Add `fmt.*printfln`

Open Tetralux opened this issue 1 year ago • 1 comments

Adds the following procedures, which just call through to the printf versions, with newline = true; a new parameter also added in this commit. In all cases, wprintf is the one that ultimately writes the newline, if requested.

  • printfln
  • fprintfln
  • eprintfln
  • aprintfln
  • tprintfln
  • bprintfln
  • caprintfln
  • ctprintfln
  • sbprintfln
  • wprintfln

These procs are useful as I often find myself switching between println and printf, and often find myself wanting the newline.

I originally just cutnpasted a version of *printf that also added a newline, but after doing so I figured that adding a newline := false parameter to the *printf procs might be a neater choice, so that's what I've done here.

I also noticed while doing this that something similar could be done with *print vs *println, but I've left that out of this PR.

Tetralux avatar Feb 18 '24 16:02 Tetralux

Ready

Tetralux avatar Feb 18 '24 16:02 Tetralux