# Setdiff with comparison function?

**URL:** <https://discourse.julialang.org/t/setdiff-with-comparison-function/31405>\
**Category:** General Usage\
**Created:** [November 23, 2019, 1:13am UTC](https://discourse.julialang.org/t/setdiff-with-comparison-function/31405 "2019-11-23T01:13:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qiyamah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiyamah/32/2660_2.png) [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Post date:** [November 23, 2019, 1:13am UTC](https://discourse.julialang.org/t/setdiff-with-comparison-function/31405/1 "2019-11-23T01:13:38Z")

</div>

I need to setdiff between 2 containers using a custom comparison function?  
Is there such a thing?

Thanks

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [November 24, 2019, 6:53am UTC](https://discourse.julialang.org/t/setdiff-with-comparison-function/31405/2 "2019-11-24T06:53:23Z")

</div>

You mean an arbitrary function instead of `==`? I am not sure that the result of that is well-defined.

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [November 24, 2019, 7:11am UTC](https://discourse.julialang.org/t/setdiff-with-comparison-function/31405/3 "2019-11-24T07:11:29Z")

</div>

It might be easier to just implement your own function rather than trying to fit your application in the `setdiff` paradigm.
