and if so, is there a macro for immutable and type that defines == and hash automatically over the fields?
thanks, andrew On Friday, 5 June 2015 15:09:08 UTC-3, andrew cooke wrote: > > > is the following correct (the docs are not very detailed, imho)? > > * immutable types have equality and hash based on the values they contain, > while mutable types are based on address (documented in docs for Base.is()) > > * if an immutable (composite) type contains a mutable (composite) type > then the "bits" in this case are a pointer to the actual type, and so > effectively the contribution to the immutable's equality / hash is based on > the address of the mutable component > > * if an immutable (composite) type contains another immutable (composite) > type then it is *always* inlined and so the bits are used as expected. > > thanks, > andrew > >
