Skip to content

Instantly share code, notes, and snippets.

@gugat
Created December 16, 2015 06:34
Show Gist options
  • Select an option

  • Save gugat/210f5be93b162f1f0ebc to your computer and use it in GitHub Desktop.

Select an option

Save gugat/210f5be93b162f1f0ebc to your computer and use it in GitHub Desktop.
Find ocurrences of items
(let [my_list '(a b b c a a c) my_set (set my_list)]
(zipmap
my_set
(map
(fn [y]
(count
(filter
(fn [x] (= x y)) my_list
)
)
) my_set
)
)
)
@jplaza
Copy link
Copy Markdown

jplaza commented Dec 22, 2015

Similar a la mía pero igual válida 😄
Que viva la programación funcional 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment