A function wrapping Julia @sprintf will be typesafe, but will have terrible performance. One could cache the generated functions though, so that the format string will only be used as a lookup in a hash table that points to the specialized (typesafe) function for that format string.
kl. 13:49:09 UTC+1 torsdag 4. desember 2014 skrev Mike Innes følgende: > > I'm not sure I understand – C's sprintf certainly has problems with type > safety, but a function wrapping Julia's @sprintf can't *not* be strongly > typed. No? > > On 3 December 2014 at 23:43, <[email protected] <javascript:>> wrote: > >> >> As Stefan said above, the problem with traditional (s)printf functions is >> type safety. >> >> On Thursday, December 4, 2014 4:53:17 AM UTC+10, Mike Innes wrote: >>> >>> #9423 <https://github.com/JuliaLang/julia/pull/9243> should help with >>> the repetition of format strings issue. It occurs to me now that you can >>> always just write a function wrapper for `@sprintf` to solve that issue but >>> this might still be useful. >>> >>> [...] >> > >
