[fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Thu Aug 30 10:40:11 CEST 2012


Arioch wrote:
> tcoq wrote
>>  a laziness to software design: what you can't name you actually don't
>> design...
>>
> Guess you meant "don't want to" instead of "can't"
> And You mean all the non-named arrays, don't you.
> 
> "var x: array[0..10] of integer; " is not only violating Pascal Report, but
> also is twice lazy.
> since one should name every part of design one should type like
> 
> type 
>     SomeEnumSemanticName = 0..10;
>     SomeEnumMapSemanticName = array[SomeEnumSemanticName] of integer;
> var x: SomeEnumMapSemanticName;

Except that not defining a distinct type emphasises that the array is 
only being declared once, and is not being passed around as a parameter. 
So I'd suggest that there are cases where the first example is 
appropriate, except obviously that that ..10 is rarely if ever acceptable.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list