Open GoogleCodeExporter opened 8 years ago
Another issue with isolates currently is that they use the default
identity-semantics for ==. Usually, however,
it is more meaningful to define equality in terms of the structure of isolates,
rather than in terms of their
identity (since they are copied a lot and copying changes identity, but not
structure).
There seems to be a relationship between at first unrelated concepts:
- mutability: immutable vs deeply immutable vs mutable
- equality: equal-by-id vs equal-by-value, i.e. are 2 objects equal based on
identity or their values?
- allocation: stack-allocation vs heap-allocation
- parameter-passing: pass-by-copy vs pass-by-reference
These seem to define a wide spectrum, e.g.:
- numbers are immutable, equal-by-value, can be stack-allocated (in C and Java,
at least) and are therefore
usually pass-by-copy.
- objects can be mutable, are usually equal-by-id, are usually heap-allocated
and therefore passed by
reference.
Isolates are pass-by-copy objects, but they do not 'fix' the mutability and
equality dimensions. Therefore,
these dimensions may interfere.
Original comment by tvcut...@gmail.com
on 16 Sep 2008 at 3:19
Original issue reported on code.google.com by
tvcut...@gmail.com
on 16 Sep 2008 at 3:13