JuliaServices / AutoHashEquals.jl

A Julia macro to add == and hash() to composite types.
Other
57 stars 12 forks source link

When cacheing, rewrite existing inner ctors to use the inner ctor that is generated instead of new. #38

Open gafter opened 1 year ago

gafter commented 1 year ago

See https://github.com/RelationalAI-oss/MuttsInterface.jl/blob/master/src/MuttsInterface.jl for one way to do it.

gafter commented 11 months ago

This can be used to address comments in raicode such as

# TODO Once AutoHashEquals supports inner constructors with typed arguments, we can use
# @auto_hash_equals cache=true hashfn=xxxxx typearg=false typeseed=yyyyy compat1=true struct Zzzzz
#     ...
# end
# Note that current `@auto_hash_equals` will then define new methods for both
# `xxxxx` and `Base.hash` for `Zzzzz` in terms of `xxxxx`