raffopazzo / depc

Like C and C++ but with Dependent Types
1 stars 1 forks source link

Remove custom range from user-defined integral types #60

Closed raffopazzo closed 1 month ago

raffopazzo commented 1 month ago

Imagine you define typedef hours_t = unsigned 8 bit integer from 0 to 23. In order to ensure consistent behaviour of arithmetic expressions between types like these and standard integral types, expressions like 23 + 2 should yield 1 both at compile-time and run-time. Or for some other 8-bit type ... from 0 to 250 the expression 250 + 250 should yield 249. This is not too complex but it's a bit of work that currently adds very little value. So for now we can just remove this feature and perhaps add it back later?