Chris Murphy
Chris Murphy

Reputation: 6509

map over a hash-map, needs to return a hash-map

What the map function will be accepting will be a 'mapping' function and a hash-map. The mapping function will be accepting values of type MapEntry. That is because the collection (hash-map) coming in looks like this: {k v k v k v}, and a MapEntry is this: k v.

I cannot seem to get a {k v k v k v} to be returned. I can easily get ([k v] [k v] [k v]).

Upvotes: 3

Views: 128

Answers (1)

Chris Murphy
Chris Murphy

Reputation: 6509

I thought of this when just finished typing the question. All you need to do is (into {} ([k v] [k v] [k v])). That will give {k v k v k v}.

Upvotes: 6

Related Questions