I’ve been using Swift for a while. There’s one Swift language feature that I really want it to be on Pascal language. It’s named parameter. It really helps when you have a function that has many parameters with default value. I hope someday Oxygene will provide that feature.
I’m sorry, but I don’t think “multi-part method names” is really similar to “named parameter” I’m talking about. Named parameter in Oxygene should be like this:
// method declaration
method m(i: integer := 0; s: string := ''; d: double);
begin
// fill code here
end;
// method calling
m(s := 'text', 0.1); // supply the s and d param
m(0.2); // only supply the required d param
// supply all the params without proper order is fine,
// as long as the parameter name is given
m(d := 0.3, s := 'text', i := 3)
// supply param with similar variable name is fine,
// because the compiler knows what each means
var s := 'another text';
var d := 0.4;
m(s := s, d := d);
i know how named parameters work in Swift. we ship a Swift compiler. of course i know how named parameters work in Swift. but Swift isn’t Oxygene, and Oxygene uses a different syntax, has been since, again, years before Swift was even dreamt of. We’re not gonna change that on a whim…
Well, I thought Oxygene is the modern object Pascal dialect. IMO, named parameters is good for modern object Pascal language. It makes Oxygene safer, more expressive and elegant. That’s why I think it should be adopted into Oxygene. But, if you think Oxygene doesn’t need that, what can I say?