I do not understand why there are so many different helpers
Why not call them all "type helper" ?
Because it was Delphi that introduced
class helper and
record helper. True, it was me that introduced
type helper for primitive types, but with FPC 3.2.0 and newer it's possible to use
type helper with classes and records as well, so for
me type helper is
the definite syntax for helper types (though the other two will be available no matter what).
type
TFoo = class(TBar) // or any other type
{..}
end;
type
// instead of: TFooHelper = class helper for TFoo
TFooHelper = helper(TFoo)
{..}
end;
type
// instead of: TFooHelper2 = class helper(TFooHelper) for TFoo
TFooHelper2 = helper(TFooHelper)
// or
TFooHelper2 = helper(TFoo, TFooHelper)
{..}
end;
This should be enough.
True, that would be enough, but we'd need to support the other syntax anyway due to Delphi compatibility. The
type helper syntax on the other hand is a close enough extension.