Comment by oblio
6 years ago
> such as ensuring an integer is in a particular range
I find it funny that one of the most advanced programming languages of our day can't do what Pascal did back in 1980 :-)
6 years ago
> such as ensuring an integer is in a particular range
I find it funny that one of the most advanced programming languages of our day can't do what Pascal did back in 1980 :-)
"can't do" is not the same as "is not a syntactical built-in". Of course Haskell can represent bounded integers:
http://stackoverflow.com/q/7302735
Also, Pascal's ranged integers are only for literals; the are not thoroughly enforced by the compiler. They are trivial to circumvent:
https://tio.run/##y0/KSk0u0S1ILE5OzNFNK0j@/z@gKD@9KDFXISU1N9...