Skip to main content
6 events
when toggle format what by license comment
Sep 30, 2016 at 19:32 comment added rwong In general, inheritance as provided by OOP languages are insufficient for implementing access control. See my answer to another question.
Sep 30, 2016 at 19:31 comment added rwong Mutability/immutability speaks about a property of the object itself, whereas readability/writeability speaks about what other functions are allowed to perform on this object. The typical approach is to say that a mutable object provides both read and write access, whereas an immutable object only provides read access. There is an additional kind of object, called a read-only proxy, which provides read-only access to an otherwise mutable object. The read-only proxy is needed to prevent other functions from using type casting to get around interface-based access control.
Oct 6, 2015 at 18:31 comment added Yttrill And you may say "but there are operations on matrices which do not preserve symmetry". Good. You got it. OO doesn't work. Stop trying to build a perpetual motion machine. It's been proven, mathematically, to be impossible. In this case it is well known that the variances on a function of higher arity alternate, OO requires the second argument to be covariant, but it isn't, so OO is known and proven beyond doubt to be incapable of representing relationships (or any N-ary concept with N greater than 1).
Oct 6, 2015 at 18:25 comment added Yttrill The "OO" is-a relation is exactly the one that one has in natural language. For example a symmetric matrix ISA matrix. It is a subtype. Every symmetric matrix is an example of a matrix. The word "sub type" means precisely the same as "subset of the values of".
Oct 6, 2015 at 10:01 comment added Deduplicator An immutable T is most certainly not a mutable T, as the first promises the T cannot be modified at all, not only not through that alias. Both can be accessed through a constant reference though to promise not modifying through the used alias.
Oct 6, 2015 at 9:41 history answered utnapistim CC BY-SA 3.0