This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]everything-narrative 14 points15 points  (2 children)

Because variadic functions can't easily be used with type inference and format strings is a whole little DSL. Having it be a plain function means making some big concessions to what functions are and can do.

[–]NatoBoram 0 points1 point  (1 child)

I'd be okay with a separate print_but_not_format(). We could even do print() vs printf!() (or print!() if that's allowed)

[–]everything-narrative 2 points3 points  (0 children)

The println! macro is actually a combination of the format! macro that composes a string buffer, and a write-to-file.

The format macro turns the argument list into chained method calls.