import json | |
type | |
KeyValue = tuple[key: string; val: string] | |
proc tt(x: KeyValue) = | |
var it = x | |
let a = (it.key, it.val) | |
echo a | |
proc encodedQuery(node: JsonNode): string = | |
var query: seq[KeyValue] | |
for q in node.pairs: | |
query.add (key: "hello", val: $q.val) | |
for elem in query: | |
elem.tt() | |
proc main = | |
var cq = newJObject() | |
cq["a"] = newJInt(1) | |
cq["b"] = newJInt(2) | |
let enc = cq.encodedQuery() | |
echo enc | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment