3 ms·
The real power comes, when you can express: var age: 18 ... 120; This is more than 50 years old Pascal. As far as I know the only mainstream language that
by weinzierl 2y ago
The real power comes, when you can express:
var age: 18 ... 120;
This is more than 50 years old Pascal. As far as I know the only mainstream language that supports this in its type system (and compile-time checked) today is Ada[1]. Blows my mind. I never got over the loss when I switched to C.
[1] I think you could convince Rust to do something pretty close but a bit uglier syntax-wise.
- xigoi 2y agoNim also supports this. var age: range[18..120]