We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 200d091 commit 43bcbcaCopy full SHA for 43bcbca
src/private/value.nim
@@ -58,6 +58,18 @@ proc `[]`*(v: Value, i: int): string =
58
## It is an error to use it on other kinds of Values.
59
v.list_v[i]
60
61
+iterator items*(v: Value): string =
62
+ ## Iterate over the seq of a vkList Value.
63
+ ## It is an error to use it on other kinds of Values.
64
+ for val in v.list_v:
65
+ yield val
66
+
67
+iterator pairs*(v: Value): tuple[key: int, val: string] =
68
+ ## Iterate over the seq of a vkList Value, yielding ``(index, v[index])``
69
+ ## pairs.
70
71
+ for key, val in v.list_v:
72
+ yield (key: key, val: val)
73
74
proc str(s: string): string =
75
if s.is_nil: "nil"
0 commit comments