you may be interested in https://github.com/andrewcooke/AutoHashEquals.jl, 
but it uses all entries.  i will consider adding that feature, though (with 
the idea that if it's not used at all, all are used).

more generally - and this may just be a problem with my programming style - 
i find that there's a problem with julia (or me) conflating two different 
things:

  * record types
  * immutable types

immutable types in julia are intended, as far as i can see, for small, 
value-like things that are stored on the stack.  while "types" are for 
larger, record like things.

some of us (perhaps coming more from a functional programming background) 
like to program with records that are immutable,  we have no way to do that 
in julia except by convention.

hence the need for AutoHashEquals (imho) (there are two problems - first, 
most obviously, you then want record equality to depend on contents, but 
second, less obviously, when these "immutable records" are used in 
immutable types then you want the immutable type's hash to depend on the 
record's contents, and not on the pointer value.  hence applying the macro 
to both types).

andrew


On Friday, 17 July 2015 12:52:52 UTC-3, Seth wrote:
>
> Perhaps a @unique macro in front of the type field could specify that this 
> is to be used in equality/hashing?
>
>

Reply via email to