Comment Comment by Animats Depends on whether you're measuring or counting.The article mentions Mesa's interval syntax, which gave programmers all the possible options:[1..100] (0 .. 101) [1 .. 101) [1 .. 101)were all the same interval, 1 to 100 inclusive. Bad idea. Great way to get off-by-one errors.Another bad idea from that era - Wirth's insistence that you shouldn't be allowed compile-time arithmetic in Pascal. Like. const tabsize = 100; var tab: array [0..tabsize-1] of integer; { NOT ALLOWED } No, you had to have a separate named constant for "tabsize-1", and it couldn't be initialized as "tabsize-1", either. parent Animats 6 years ago
The article mentions Mesa's interval syntax, which gave programmers all the possible options:
[1..100] (0 .. 101) [1 .. 101) [1 .. 101)
were all the same interval, 1 to 100 inclusive. Bad idea. Great way to get off-by-one errors.
Another bad idea from that era - Wirth's insistence that you shouldn't be allowed compile-time arithmetic in Pascal. Like.
No, you had to have a separate named constant for "tabsize-1", and it couldn't be initialized as "tabsize-1", either.