1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 11:09:54 +00:00

Improve docstring for the invert function.

This commit is contained in:
Harry Prins 2021-08-06 18:33:49 +02:00 committed by GitHub
parent 61769c8f16
commit 5f3378213b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1323,8 +1323,9 @@
(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 the
value, one key will be ignored.` original 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]