in reply to Re: Action at a distance (updated)
in thread Action at a distance
I wouldn't go with tie (if it even works?). I'd overload = to automatically clone the object on assignment.
Another approach is to use immutable objects. Such a class wouldn't provide a method for incrementing the object; it would provide a method that returns a new object with the higher value.
Both of these approaches add the unnecessary computational and memory overhead of creating clones in situations where they aren't needed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Action at a distance
by LanX (Saint) on Nov 03, 2022 at 15:05 UTC |