News for hackers. Stuff that matters.
Re:Parse, Don’t Validate by oblio on Thursday November 07, 2019 @11:10PM (#21479904)
> 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 :-)

Re:Parse, Don’t Validate by papln on Friday November 08, 2019 @11:50AM (#21484033)
"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:

    var
      y,z: 5..10;

    Begin   
      Read(y);   Writeln(y);  // 60 works here
      y := 10;
      z := 2*y;  Writeln(z);
https://tio.run/##y0/KSk0u0S1ILE5OzNFNK0j@/z@gKD@9KDFXISU1N9...