Posts

Showing posts with the label OO

Dependency Dejection

In Dart, A ∪ B != B ∪ A

The title is misleading, other languages are prone to this gotcha. At least that's less deceptive than "Hot mathematician refutes conjecture with a weird trick". Be amazed People stop me in the subway arguing it's contrived or even ill formed. Stepanov answers (*) that basic math properties should be respected, all the more nothing forewarns the possible asymmetry of the addAll operation. If it's ill formed, shouldn't the langage tell you? C++ would reject that at compile time. Model consistency You could consider this behavior as perfectly fine since the respective models of d1 and d2 (sensitivity to the case) are preserved. Nevertheless, the commutativity of union isn't, breaking the consistency. Julia Belyakova's paper notes that dependent types allows models consistency by letting the comparer be a part of the type. Does it suggest that C++ templates can encode dependent types? If not, it means that models consistency relies on a sub-...