MS has Windows Server running on ARM (again).

MS has Windows Server running on ARM (again).

In context of the recent Web Assembly post about what platforms Delphi should support, I would rank Windows ARM support for Delphi far, far higher than WASM, since I write services running on Windows Server.

https://azure.microsoft.com/en-gb/blog/enabling-cloud-workloads-through-innovations-in-silicon/

It’s not always easy to pick a good color that will show well on displays with limited color depths.

It’s not always easy to pick a good color that will show well on displays with limited color depths.

If anyone knows if this exists – or have some time on their hands, it would be good to have a simple application that could render the System.UITypes TColors constants for lines/text/brushes on different color depths (8 bit, 16-bit, 32-bit). Showing the name of the color (or atleast the hex value) would be good and being able to copy it to the clipboard as a string would be great.

Wish: Interface support for record/class helpers

Wish: Interface support for record/class helpers

Scenario: We are adding record helpers for all our enumerated types to reduce code clutter and enhance readability

type

TMyEnum = (A, B C);

TMyEnumHelper = record helper for TMyEnum

function ToString:string;

function Description: string;

end;

The old pattern was to create

function TMyEnumValueToString(const Value: TMyEnum):String;

function TMyEnumDescription(const Value: TMyEnum):String;

in addition to the enumerated type.

Rather than having to write

var

Code: TMyEnum;

begin

Writeln(TMyEnumValueToString(Code), ‘ ‘, TMyEnumDescription(Code));

We can now write

var

Code: TMyEnum;

begin

Writeln(Code.ToString, ‘ ‘, Code.Description);

which reads a lot better.

But – For unit testing, this creates another predicament

We have used an RTTI trick to create a loop for each value in anon.type T for enumerations, and hence had a

type

TEnumTester

type

reference to function EnumToString(const Value: T):String;

end;

But there is no such way to “genericize” a helper method.

type

IEnumHelper = interface

function ToString:string;

function Description: string;

end;

I can’t declare an interface which a record helper have to adher to, as there is no syntax to do so, and I can’t constrain the generic type to match that interface

My suggestion would be to allow something like

type

TMyEnumHelper = record helper for (TMyEnum, IEnumHelper)

function ToString:string;

function Description: string;

end;

TEnumTester = class

end;

and be able to declare

var

TestMyEnum: TEnumTester;

Today the interface constraint fails with

[dcc32 Error] : E2514 Type parameter ‘T’ must support interface ‘IEnumHelper’

since the enumerated type is not recognized as having support for the interface.

I think that would have been helpful – as would a generics constraint for enumerated types be.

Quality Portal Issue RSP-16799

https://quality.embarcadero.com/browse/RSP-16799