mirror of
https://github.com/janet-lang/janet
synced 2024-11-25 09:47:17 +00:00
Update documentation for update function.
This commit is contained in:
parent
9100794cea
commit
20e94adb61
@ -914,8 +914,9 @@
|
|||||||
res)
|
res)
|
||||||
|
|
||||||
(defn update
|
(defn update
|
||||||
"Accepts a key argument and passes its' associated value to a function.
|
"Accepts a key argument and passes its associated value to a function.
|
||||||
The key then, is associated to the function's return value"
|
The key is the re-associated to the function's return value. Returns the updated
|
||||||
|
data structure ds."
|
||||||
[ds key func & args]
|
[ds key func & args]
|
||||||
(def old (get ds key))
|
(def old (get ds key))
|
||||||
(set (ds key) (func old ;args)))
|
(set (ds key) (func old ;args)))
|
||||||
|
Loading…
Reference in New Issue
Block a user