Re: union using a comparison function

2010-09-05 Thread Thomas
I assume you have to vectors, v1 and v2, and you want to add all the
elements from v1 that doesn't equal any element from v2 to v2. In that
case you're probably best of using filter to extract the elements from
v1 that are not equal to any element in v2. concat the result with v2.

Thomas

On Sep 2, 5:10 pm, mlimotte mslimo...@gmail.com wrote:
 Hi.

 I'd like to do a union of some sequences using my own comparison
 function.  Similar to supplying a Comparator in Java.  The things
 being compared are Objects from a Java library that I don't control,
 so I can't just override the equals function on the class, for
 example.

 Would aprecaite any suggestions.

 thanks,
 Marc

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


union using a comparison function

2010-09-02 Thread mlimotte
Hi.

I'd like to do a union of some sequences using my own comparison
function.  Similar to supplying a Comparator in Java.  The things
being compared are Objects from a Java library that I don't control,
so I can't just override the equals function on the class, for
example.

Would aprecaite any suggestions.

thanks,
Marc

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: union using a comparison function

2010-09-02 Thread Robert McIntyre
By union do you mean union as in sets, or just smashing the two lists together?

--Robert McIntyre

On Thu, Sep 2, 2010 at 11:10 AM, mlimotte mslimo...@gmail.com wrote:
 Hi.

 I'd like to do a union of some sequences using my own comparison
 function.  Similar to supplying a Comparator in Java.  The things
 being compared are Objects from a Java library that I don't control,
 so I can't just override the equals function on the class, for
 example.

 Would aprecaite any suggestions.

 thanks,
 Marc

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en