[fpc-pascal] Feature proposal: function-based assignment operators

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Thu Mar 28 18:36:38 CET 2013


Sven Barth wrote:

> type
>   TLongIntHelper = type helper for LongInt
>     procedure Min(aValue: LongInt);
>   end;
> 
> procedure TLongIntHelper.Min(aValue: LongInt);
> begin
>   Self := Math.Min(Self, aValue);
> end;

>   arr[15].Min(10); // arr[15] is passed as Self to Min

I thought there was something like that, but I couldn't put my finger on 
it :-)

-- 
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