Alternative constructor names

Oxygene provides a compatibility option to use the legacy .Create constructor. Is there any way to use a similar syntax but with custom constructor names? For example, MyObject.InitMyObject

You can use Cocoa-style named/multi-part constructors:

constructor withString(a: String);
begin
end;

...

b := new Foo withString("bar");

But in this case the new keyword is still required, right? Whereas with the Create legacy constructor I can just call b := Foo.Create? Is there a way to use this sort of syntax with a method name other than Create?

new is always required, yes. unless you add static factory methods of course.

what’s your end goal here?

Create a static method that returns an instance of the class and name it as you want.

Trying to work with FPC common code to find a single constructor solution that works for FPC and Oxygene so that we don’t have to use compiler directives in every constructor. It looks like Create is our only realistic option there, right? Even with static factory methods we would need to use compiler directives around the Oxygene bits.

Well, those could look like FPC constructors, if you call them the same?