3 ms·
>No one claimed it wasn't useful, simply that it's not necessary to have objects. "Immutable data structures necessarily don't have identity (well, to say iden
by ratmice 9y ago
>No one claimed it wasn't useful, simply that it's not necessary to have objects.
"Immutable data structures necessarily don't have identity (well, to say identity isn't meaningful because aliases can simply be seen as copies)."
I read saying that it is necessariy for them not to have identity, and that giving them identity isn't useful or meaningful.
If it said "don't necessarily" instead of necessarily don't, I would agree
- seanmcdirmid 9y agoMy point here was whether they had identities or not wasn't meaningful, since they are (well, should be) purely judged by their value. I didn't make any value judgements about the usefulness of immutable data structures.
- ratmice 9y agoExactly what I thought you were saying, and disagree with. I consider it fine to say "Objects require identity", without identity a fully encapsulated object is nothing more than an anonymous black hole. When you turn this around to "Only objects require identity", or "identity is not meaningful for data", a hash code is one example of data which could benefit from identity, since you do not want to mix hash codes made by different hash functions. The positive integers 0,1,2... differentiated between the set of nonnegative integers are another simple to preclude identity from data, is to preclude the ability to differentiate these on anything but the value level. surely a simplification, but by no means necessary.
- seanmcdirmid 9y agoHash functions on values don't depend on identity and collisions are accepted as part of hash's definition. A GUID (and MD 5 hashes) for all practical purposes are identities. Identities really mess up equational reasoning which is why they are basically missing from pure functional languages like Haskell. A lot of clever solutions like FRP involve solving what are otherwise straightforward problems without resorting to the use of identity.
- ratmice 9y agoIdentities do not mess anything up, the commonly employed implementations of identity however do... again check out modula-3 and more recently the paper at http://drops.dagstuhl.de/opus/volltexte/2015/5231/ http://drops.dagstuhl.de/opus/volltexte/2015/5231/ Apologies I meant the identity of the hash algorithm e.g. MD5, attached to the bits produced by running the hash algorithm on an object, while hash collisions are absolutely accepted, mixing hash values produced by different hash functions is generally frowned upon. Identity at the structural level is very much either you care about the identity, or you do not (in which case "this one"...), maybe 99.9% of the time "this one" suffices, however the takeaway from this should be that identity of structurally transparent objects should be ignorable, rather than structurally transparent objects should not have identity should one care to acknowledge it.