mirror of
https://github.com/janet-lang/janet
synced 2025-01-14 17:35:41 +00:00
Merge pull request #754 from harryvederci/patch-1
Improve docstring for the invert function.
This commit is contained in:
commit
c94d7574bc
@ -1351,9 +1351,10 @@
|
|||||||
ret)
|
ret)
|
||||||
|
|
||||||
(defn invert
|
(defn invert
|
||||||
`Returns a table where the keys of an associative data structure
|
``Returns a table where the keys of an associative data structure
|
||||||
are the values, and the values of the keys. If multiple keys have the same
|
are the values, and the values are the keys. If multiple keys in `ds`
|
||||||
value, one key will be ignored.`
|
are mapped to the same value, only one of those values will
|
||||||
|
become a key in the returned table.``
|
||||||
[ds]
|
[ds]
|
||||||
(def ret @{})
|
(def ret @{})
|
||||||
(loop [k :keys ds]
|
(loop [k :keys ds]
|
||||||
|
Loading…
Reference in New Issue
Block a user