4 ms·
The interesting thing here is that the typesafe printf has its function arguments inferred from a string literal, at compile time. You can change the 9 to a "9"
by yen223 3y ago
The interesting thing here is that the typesafe printf has its function arguments inferred from a string literal, at compile time. You can change the 9 to a "9" and see the type error even before running the code.
This is something that most mainstream language's type system cannot do.
(This may be obvious, but a lot of commenters here might have missed that.)