Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interface around {fmt} for
cpp11::stop()
and cpp11::warning()` message formatting #209interface around {fmt} for
cpp11::stop()
and cpp11::warning()` message formatting #209Changes from 13 commits
2ea819c
57beaac
c453f48
80f4c78
2918ebd
0cb2f77
30dbd64
743c2ca
7a8a4d7
860bd53
f45593d
d51a3cd
1749d62
e1e8f1b
cb2ccca
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it's unfortunate that we're losing the
%x
format specifier forSEXP
s. This could be recoverable by introducing a helper function:Used like so:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you would use
cpp11::stop("{0:x}", my_sexp)
, or ({0:#x}
if you want the leading 0x) to print the hexadecimal address for a sexp. (https://fmt.dev/latest/syntax.html#format-examples)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I misunderstood the purpose of
%x
. I thought it gave a string representation of the pointed value rather than a representation of the pointer itself. Let me rephrase: would it be desirable to interceptSEXP
pointers and replace them withcapture.output(print(value))
or so? It'd probably be better to include that as asexp::to_string()
so that we can writeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, maybe, though it is not always clear what output would be preferred for a given SEXP, possibly something like that returned from
R_inspect()
might be the most useful for any SEXP type, though the default arguments can generate a lot of data for deeply nested objects.