Clojure

GC Issue 52: Make set/union accept any number of arguments

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Reported by konrad.h...@laposte.net, Jan 20, 2009
Describe the feature/change.

set/union currently accepts two sets as arguments. The operation is well defined for any number of 
sets and similar operations (+, concat, ...) take any number of arguments, so I think set/union 
should do so as well.

Was this discussed on the group? If so, please provide a link to the discussion:


 set-union.diff
575 bytes Download
Comment 1 by scgilardi, Jan 20, 2009
There are implementations here as well:

http://groups.google.com/group/clojure/msg/5bb548afe2cbbe02

At one point, this was on Rich's public Clojure "to-do" list.

Comment 2 by wolfe.a.jason, Jan 22, 2009
On a somewhat related note, let me plug my own post about efficient set operations:

http://groups.google.com/group/clojure/browse_thread/thread/29609929e94f279c?hl=en#

(I am in favor of multi-arg set functions as well; while my versions don't do this, I
believe this can be done simply by (reduce union #{} sets) or (reduce
intersection/difference (first sets) (rest sets))


Comment 3 by wolfe.a.jason, Feb 02, 2009
This may now be subsumed by this issue:

http://code.google.com/p/clojure/issues/detail?id=64&colspec=ID%20Type%20Status%20Priority%20Reporter%20Owner%20Summary

which includes a patch for multi-arg, more efficient
clojure.set/union/difference/intersection functions.
Comment 4 by richhickey, Feb 22, 2009
(No comment was entered for this change.)
Status: Fixed

People

  • Assignee:
    Unassigned
    Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: