a7cd70c84a
As a neat syntactic sugar, it's very neat if maps and lists are able to work as if they were functions, and look up their arguments. This implements just that, by translating (map key) to (index map key) internally, and (list idx) to (index list idx). Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
6 lines
101 B
Hy
6 lines
101 B
Hy
(defn test-map-index []
|
|
({"foo" "bar"} "foo"))
|
|
|
|
(defn test-list-index []
|
|
(["first" "second"] 1))
|