Pascal as a professional programming tool was pretty much dead by the mid 80's, although Wirth's book on algorithms and data structures was probably still in use and had a Pascal style syntax for the examples. Anyone with a reasonable knowledge of C could pick up Pascal in a couple of days.
What I was alluding to is that in Pascal, one defines the size of an array by the valid indices for that array. For example,
someString: array [0..99] of char;
defines a C style array of 100 bytes, indexed from 0 to 99
But to get a bit weird...
fooArray: array [-100..100] of foo;
defines an array of type foo containing 201 elements that can be indexed from -100 to 100. And yes, any arbitrary values such as 17..77 can be used.
This maybe useful for some programming problems, but I've never needed anything like it.
(no subject)
Date: 2009-12-28 04:43 pm (UTC)Pascal as a professional programming tool was pretty much dead by the mid 80's, although Wirth's book on algorithms and data structures was probably still in use and had a Pascal style syntax for the examples. Anyone with a reasonable knowledge of C could pick up Pascal in a couple of days.
What I was alluding to is that in Pascal, one defines the size of an array by the valid indices for that array. For example,
someString: array [0..99] of char;
defines a C style array of 100 bytes, indexed from 0 to 99
But to get a bit weird...
fooArray: array [-100..100] of foo;
defines an array of type foo containing 201 elements that can be indexed from -100 to 100. And yes, any arbitrary values such as 17..77 can be used.
This maybe useful for some programming problems, but I've never needed anything like it.