(first (mapify (parse (slurp filename))))
; => {:glitter-index 10, :name "Edward Cullen"}
diff --git a/content/cftbat/core-functions-in-depth.html b/content/cftbat/core-functions-in-depth.html index 0eee3948..29da9b6b 100644 --- a/content/cftbat/core-functions-in-depth.html +++ b/content/cftbat/core-functions-in-depth.html @@ -742,7 +742,7 @@
In this function, map transforms each row—vectors like ["Bella Swan" 0]—into a map by using reduce in a manner similar to the first example in “reduce” above. First, map creates a seq of key-value pairs like ([:name "Bella Swan"] [:glitter-index 0]). Then, reduce builds up a map by associating a vamp key with a converted vamp value into row-map. Here’s the first row mapified:
In this function, map transforms each row—vectors like ["Bella Swan" 0]—into a map by using reduce in a manner similar to the first example in reduce above. First, map creates a seq of key-value pairs like ([:name "Bella Swan"] [:glitter-index 0]). Then, reduce builds up a map by associating a vamp key with a converted vamp value into row-map. Here’s the first row mapified:
(first (mapify (parse (slurp filename))))
; => {:glitter-index 10, :name "Edward Cullen"}