3 ms·
> arbitrary rules a programmer knows about the bounds of a value Ada's generalized type contracts using subtype predicates work pretty well for this: https://l
by andsoitis 2y ago
> arbitrary rules a programmer knows about the bounds of a value
Ada's generalized type contracts using subtype predicates work pretty well for this: https://learn.adacore.com/courses/Ada_For_The_CPP_Java_Developer/chapters/05_Type_System.html#generalized-type-contracts-subtype-predicates https://learn.adacore.com/courses/Ada_For_The_CPP_Java_Devel...
You can use it for something as simple as expressing ranges, or to represent types with arbitrary constraints, including types with discontinuities.