Skip to content

Commit 0b9d2e7

Browse files
committed
chore(docs): update examples of Dict.ark to be accurate
1 parent c13f009 commit 0b9d2e7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Dict.ark

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@
102102
# @param _f function to apply to each value, taking both key and value as arguments
103103
# =begin
104104
# (let data (dict "key" "value"))
105-
# (dict:map data (fun (key value) (format "{}-{}" key value)))
106-
# (print data) # {key: key-value}
105+
# (let new (dict:map data (fun (key value) (format "{}-{}" key value))))
106+
# (print data) # {key: value}
107+
# (print new) # {key: key-value}
107108
# =end
108109
# @author https://github.com/SuperFola
109110
(let map (fun (_D _f) {
@@ -122,7 +123,7 @@
122123
# @param _f function to apply to each value, taking both key and value as arguments
123124
# =begin
124125
# (let data (dict "key" "value"))
125-
# (dict:map data (fun (key value) (format "{}-{}" key value)))
126+
# (dict:map! data (fun (key value) (format "{}-{}" key value)))
126127
# (print data) # {key: key-value}
127128
# =end
128129
# @author https://github.com/SuperFola
@@ -181,9 +182,8 @@
181182
# @param _f predicate, taking both key and value as arguments
182183
# =begin
183184
# (let data (dict "key" "value" "hello" "world"))
184-
# (let new (dict:filter data (fun (key value) (> (len key) 3))))
185-
# (print data) # {key: value, hello: world}
186-
# (print new) # {hello: world}
185+
# (dict:filter! data (fun (key value) (> (len key) 3)))
186+
# (print data) # {hello: world}
187187
# =end
188188
# @author https://github.com/SuperFola
189189
(let filter! (fun (_D _f) {
@@ -224,7 +224,7 @@
224224
# =begin
225225
# (let data (dict "key" "value" "hello" "world"))
226226
# (let new (dict "key" "new value" 5 12))
227-
# (dict:update data new)
227+
# (dict:update! data new)
228228
# (print data) # {key: new value, hello: world, 5: 12}
229229
# =end
230230
# @author https://github.com/SuperFola

0 commit comments

Comments
 (0)