|
102 | 102 | # @param _f function to apply to each value, taking both key and value as arguments
|
103 | 103 | # =begin
|
104 | 104 | # (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} |
107 | 108 | # =end
|
108 | 109 | # @author https://github.com/SuperFola
|
109 | 110 | (let map (fun (_D _f) {
|
|
122 | 123 | # @param _f function to apply to each value, taking both key and value as arguments
|
123 | 124 | # =begin
|
124 | 125 | # (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))) |
126 | 127 | # (print data) # {key: key-value}
|
127 | 128 | # =end
|
128 | 129 | # @author https://github.com/SuperFola
|
|
181 | 182 | # @param _f predicate, taking both key and value as arguments
|
182 | 183 | # =begin
|
183 | 184 | # (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} |
187 | 187 | # =end
|
188 | 188 | # @author https://github.com/SuperFola
|
189 | 189 | (let filter! (fun (_D _f) {
|
|
224 | 224 | # =begin
|
225 | 225 | # (let data (dict "key" "value" "hello" "world"))
|
226 | 226 | # (let new (dict "key" "new value" 5 12))
|
227 |
| -# (dict:update data new) |
| 227 | +# (dict:update! data new) |
228 | 228 | # (print data) # {key: new value, hello: world, 5: 12}
|
229 | 229 | # =end
|
230 | 230 | # @author https://github.com/SuperFola
|
|
0 commit comments