# How to implement equality test for mutable types? Hash Function Example

**URL:** <https://discourse.julialang.org/t/how-to-implement-equality-test-for-mutable-types-hash-function-example/7982>\
**Category:** General Usage\
**Created:** [December 25, 2017, 8:06am UTC](https://discourse.julialang.org/t/how-to-implement-equality-test-for-mutable-types-hash-function-example/7982 "2017-12-25T08:06:09Z")\
**Posts on this page:** 2\
**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:** [December 25, 2017, 8:06am UTC](https://discourse.julialang.org/t/how-to-implement-equality-test-for-mutable-types-hash-function-example/7982/1 "2017-12-25T08:06:09Z")

</div>

Can you give an example?

---

<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:** [December 25, 2017, 9:04am UTC](https://discourse.julialang.org/t/how-to-implement-equality-test-for-mutable-types-hash-function-example/7982/2 "2017-12-25T09:04:27Z")

</div>

Look at

> **[GitHub - JuliaServices/AutoHashEquals.jl: A Julia macro to add == and hash()...](https://github.com/JuliaServices/AutoHashEquals.jl)**
>
> A Julia macro to add == and hash() to composite types. - GitHub - JuliaServices/AutoHashEquals.jl: A Julia macro to add == and hash() to composite types.

either use `@auto_hash_equals` as a quick solution, or expand it for an example.
