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.
strformat.format
is renamed tostrformat.formatValue
, so it does not clash withstrutils.format
.callFormat
templates is removed entirely.formatValue
has to follow the interfaceformatValue*(value: T; specifier: string; res: var string)
. Hacks to support alternative interfaces are removed.formatValue
to enable custom types within to be used in the&
macro.specifier
string for their own types.nim_glm
types to be used in the&
macro.strformat
doesn't work properly inside generics #7632&
is moved below the definition offormatValue
, so thatbindSym
gets them all. Sorry that makes the diff harder to read, but it is important.breaking change:
Custom types now need to overload
formatValue
explicity. It would be possible to provide a genericformatValue
that is based on$
, but I decided against it. Most importantly, when the genericformatValue
does not exist, there is a really nice error message that tells the developer that there is a missingformatValue
that should be implemented. I also did it, because it is not clear to me what to do with thespecifier
argument.