Clojure

audit & promote some clojure.contrib.seq fns

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.2
  • Component/s: None
  • Labels:
    None

Description

Proposed for promotion to clojure.core:

flatten, separate, indexed, group-by, partition-by, frequencies, reductions, positions

Activity

Hide
Assembla Importer added a comment -

jawolfe said: Sorry if this is the wrong place to leave this comment, but I wanted to make a quick note about group-by. I use it all the time, but in almost all cases I don't care that the map I get back is sorted by key. On the other hand, I have several times run into the case where group-by fails at runtime since the keys I want to group by are not comparable to each-other. So, I would humbly ask that you consider also adding a function that does the same thing with a regular old hash-map rather than sorted map, or adding an optional parameter to group-by that takes an empty map of the desired type, or some such. Thanks...

Show
Assembla Importer added a comment - jawolfe said: Sorry if this is the wrong place to leave this comment, but I wanted to make a quick note about group-by. I use it all the time, but in almost all cases I don't care that the map I get back is sorted by key. On the other hand, I have several times run into the case where group-by fails at runtime since the keys I want to group by are not comparable to each-other. So, I would humbly ask that you consider also adding a function that does the same thing with a regular old hash-map rather than sorted map, or adding an optional parameter to group-by that takes an empty map of the desired type, or some such. Thanks...
Hide
Assembla Importer added a comment -

importer said: Similar to jawolfe's comment, I also don't care that the returned map is sorted, and I needed more performance out of group-by. By making the returned map unsorted, I was able to write my own version using transients.

Show
Assembla Importer added a comment - importer said: Similar to jawolfe's comment, I also don't care that the returned map is sorted, and I needed more performance out of group-by. By making the returned map unsorted, I was able to write my own version using transients.
Hide
Assembla Importer added a comment -

meikelbrandmeyer said: [file:cy83XYuH8r36U-eJe5cbCb]: Rewritten version of reductions using lazy-seq

Show
Assembla Importer added a comment - meikelbrandmeyer said: [file:cy83XYuH8r36U-eJe5cbCb]: Rewritten version of reductions using lazy-seq
Hide
Assembla Importer added a comment -

meikelbrandmeyer said: Added a patch for reductions. Uses now lazy-seq instead of rec-seq. See also here: http://groups.google.com/group/clojure/browse_thread/thread/3e37df49ce5edf44/cbde2d3f8b5296cd and here: http://groups.google.com/group/clojure-dev/msg/f0e2a1627a036bcd

Show
Assembla Importer added a comment - meikelbrandmeyer said: Added a patch for reductions. Uses now lazy-seq instead of rec-seq. See also here: http://groups.google.com/group/clojure/browse_thread/thread/3e37df49ce5edf44/cbde2d3f8b5296cd and here: http://groups.google.com/group/clojure-dev/msg/f0e2a1627a036bcd

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: