Things that may be removed

bearophile bearophileHUGS at
Wed Dec 17 06:33:55 PST 2008

Gide Nwawudu:
> Learning Pascal before C maybe toughen me up, I haven't
> suffered RSI typing ARRAY OF :)

But Pascal arrays have other qualities, an example:

  TyArr = Array ['e' .. 'x'] of Integer;
  a1: TyArr;
  a1['f'] := 10;

That array has that range of chars as indexes, and if you want the compiler at run time will control that only that range of chars is used. In D you can do that as (probably typedef is much less common in D code than the types section in Pascal programs):

typedef int['x' - 'e'] TyArr;
TyArr a1;
int main() {
    a1['f' - 'e'] = 10;

But maybe such things aren't common enough to deserve a special support.


More information about the Digitalmars-d mailing list