Hi Roelof, On 24 Oct 2014, at 14:05, Roelof Wobben <[email protected]> wrote:
> I have to use map and get a vector of all the second items in a list. > I know I can use map to do things with all the items in a list. > and with get I can get the second item (get collection 1) Yes, depending on what the items in the list are. For vectors, for example, that will work. > map uses this map what_has _to_be_done collection > > so I thougt this would work (map (get collection 1) collection) > but then I see this error message : java.lang.IllegalArgumentException: Key > must be integer You are applying get to a real collection. map takes a function to be applied to each element. For example, #(get % 1). More idiomatic: (map second xs). cheers lvh
signature.asc
Description: Message signed with OpenPGP using GPGMail
