Closed sbearrows closed 3 years ago
So I was thinking about this some this morning, and I think we will either have to use new function names (something like stop_fmt()
for the fmt powered functions, or put them behind a #ifdef CPP11_USE_FMT
flag that you have to opt into to use them.
This is because existing packages that are using cpp11::stop()
are going to be using the sprintf style %s
etc. message strings, and these won't work with fmt.
Another argument in favor of the #ifdef
approach is that compiling the fmt code will incur some overhead, which some people may want to avoid.
Which way do you think would be best?
I'd be in favor of the later! I think decreasing overhead is probably important to a lot of people using cpp11. What about you?
yeah that is the way I was leaning, though I worry if it is only opt-in then people may not realize it is an option / never use it.
We could try to make a ruckus about? Adding examples in documentation?
Also, could we make fmt for cpp11::stop()
and cpp11::warning()
opt-in but make fmt for the new cpp11::messages()
opt-out since it isn't present in previous versions? This might give people some breadcrumbs for the others? Not sure if that would be too confusing though.
LGTM, I think this can be merged once the tests are green.
@jimhester Let me know what you think! Tests are pretty simple but we can add more if issues arise.
Fixes #169