News for hackers. Stuff that matters.
Re:LINQ Ruined My Favorite Interview Question by calibraxis on Thursday July 11, 2013 @02:42PM (#6028200)
`frequencies` is surprisingly useful, enough to justify its inclusion into core. I once pondered why.

Consider that in Clojure, a common act transforming one datastructure into another. Typically only a few kinds: maps, sets, and some kind of sequence.

What is a highly common generic transformation of a sequence to a map? `frequencies`. Particularly since you'd only be doing this with pretty finite sequences, given the finite nature of the built-in maps. Finite here means countable. What generic, domain-independent thing would you be counting? Often, the items themselves.

There are no comments on this comment yet.