4 ms·
Which languages allow this? It looks suspiciously like dependent typing to me
by YawningAngel 6y ago
Which languages allow this? It looks suspiciously like dependent typing to me
- mrgriffin 6y agoFWIW, that's not dependent typing, because the type doesn't depend on run-time values. A bool is either true or false, a [0...1] is either 0 or, ..., or 1. As for which languages allow it. I'm not sure for floats, but Pascal let you do it for ints for sure. https://wiki.freepascal.org/subrange_types https://wiki.freepascal.org/subrange_types