Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

[FR] fprintf1() #91

Open
gustaphe opened this issue Nov 10, 2020 · 0 comments
Open

[FR] fprintf1() #91

gustaphe opened this issue Nov 10, 2020 · 0 comments

Comments

@gustaphe
Copy link

I like sprintf1() as a dynamy/performance compromise for @printf, but it's not a drop-in replacement.

When working in a print-ecosystem, you end up doing things like print(io,sprintf(frmt,x)), which unnecessarily generates a string.
I don't know the best way to implement a fprintf1 function without reusing a lot of code, but from what I've seen the most common way to do this kind of thing is to have fprintf be the base function, have sprintf use fprintf on an IOBuffer to generate the string.

Is there a strong reason to not do this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant