We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
%
currently any time an attribute is added, the % procs must be updated to include that attribute.
a macro that iterated over the fields and values would simplify this a lot.
The text was updated successfully, but these errors were encountered:
@brentp not sure i understand, but *% from std/json can do that: it can serialize (or reverse: https://nim-lang.github.io/Nim/json.html#overview-unmarshalling) objects and tuples directly, no need to iterate over fields
*%
specifically: this could be replaced by: let foo = %* a IIRC
let foo = %* a
func `%`*(a: Annotation): JsonNode = ## creates a JsonNode from an `Annotations` object depending on the object variant result = %[ ("x", %a.x) , ("xshift", %a.xshift) , ("y", %a.y) , ("yshift", %a.yshift) , ("text", %a.text) , ("showarrow", %a.showarrow) ]
Sorry, something went wrong.
I mean, for example, the ones the use ordered fields, as in: https://github.com/brentp/nim-plotly/blob/master/src/plotly/api.nim#L175
No branches or pull requests
currently any time an attribute is added, the
%
procs must be updated to include that attribute.a macro that iterated over the fields and values would simplify this a lot.
The text was updated successfully, but these errors were encountered: