Merge pull request #754 from harryvederci/patch-1

Improve docstring for the invert function.
This commit is contained in:
Calvin Rose 2021-08-08 12:51:24 -05:00 committed by GitHub
commit c94d7574bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -1351,9 +1351,10 @@
ret)
(defn invert
`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
value, one key will be ignored.`
``Returns a table where the keys of an associative data structure
are the values, and the values are the keys. If multiple keys in `ds`
are mapped to the same value, only one of those values will
become a key in the returned table.``
[ds]
(def ret @{})
(loop [k :keys ds]