CBFalconer wrote:
I think such extensions to Pascal are not likely to become generally adopted, and will create many more problems than they solve. Over 20 years ago PascalP included the extension syntax:
arraytype[initindex FOR length]
to describe a subarray. This has been especially noticeable by being totally ignored by the community, although it is a very useful (and compilable and checkable) construct. This was Bob Fraleys idea, and if it survives anywhere else it would probably be in HPs Pascal implementation.
AFAICS, this is equivalent to the EP mechanism `arraytype[initindex .. initindex + length - 1]'.
I don't know why EP chose that syntax (perhaps some other compiler(s) had that already?), but since both seem to provide the same functionality, it seems alright to have only one in the standard.
As far as the enums above are concerned, what is wrong with:
TYPE Enum1 = (e0, e1, e2, e3, e4); Enum0 = e0 .. e2;
As I wrote in another mail, that's not possible if the extension is in another module than the base type. (E.g., I define some identifying codes for some things in one module, and want to add some more in another one. The only way to do it currently (AFAICS) is to use integer constants and care for non-overlapping numbering myself.)
Of course, this issue didn't arise in the original standard which had no modules, so Wirth didn't have to consider it, and we can only guess if he'd have considered such an extension ...
Frank