2008-08-24
| 05:53 | scook0 | is there a builtin function that will take a sequence of [key val] pairs and produce a map? |
| 05:53 | scook0 | (I've written my own, but it seems like the sort of thing that ought to exist already) |
| 05:53 | kotarak | apply ;) (apply hash-map (apply concat list-with-kvs-vectors)) |
| 05:57 | blackdog | will zipmap work too? |
| 05:59 | kotarak | blackdog: zipmap works different: (zipmap [key1 key2] [val1 val2]) vs. (apply hash-map (apply concat [key1 val1] [key2 val2])) |
| 06:00 | kotarak | oops. forget [] around the last vectors |
| 06:00 | blackdog | ok |
| 06:00 | kotarak | s/forget/forgot/ |
| 09:03 | Chouser | into |
| 09:03 | Chouser | (into {} [[1 2] [3 4] [5 6]]) ==> {1 2, 3 4, 5 6} |
| 09:30 | kotarak_ | Chouser knows everything :) |
| 10:02 | kotarak | But you come close. ;) |
| 10:08 | Chouser | well, *that's* true. |
| 10:08 | Chouser | ha ha |
| 10:10 | Chouser | Rich taught me about into when I was using reduce. |
| 10:11 | Chouser | (reduce conj {} [[1 2] [3 4] [5 6]]) |
| 10:12 | kotarak | I used into to convert a map into vector, IIRC. But never the other way around. I didn't even think of using it. :( |