On Saturday, 22 July 2017 at 03:18:29 UTC, Cecil Ward wrote:
I guess part of my question, which I didn't really highlight well enough, is the issue of strong typing. [...]

Going back to the original example of packed bcd stored in a uint64_t say, first thing is that I want to ban illegal mixing of arbitrary binary values in ordinary uint64_tmtypes with decimal types, again no assignment, addition, comoarisons etc across types at all allowed. And no friendly automagically conversions [...]

All of this should be covered by wrapping in structs and overloading the appropriate operators for the types in question [1][2][3], which is why the BCDInteger struct shell I wrote has the "Overload operators" comment.

[1] https://dlang.org/spec/operatoroverloading.html#binary
[2] https://dlang.org/spec/operatoroverloading.html#assignment
[3] https://dlang.org/spec/operatoroverloading.html#op-assign

Reply via email to