Hi
I did not yet have the time to check the changes and your reply in
detail, but I already wanted to follow-up on some of the points.
Am 2025-07-23 15:55, schrieb Larry Garfield:
$c = fn(string $s, Point $p, int $m = 0) => stuff(1, $s, 3.14, $m);
I don't think this is accurate? `$p` is unused.
The choice of parameters names makes it hard to understand the
examples,
particularly when named parameters are used to provide arguments out
of
order. Including the “position” in the name of the parameter would
make
it easier to follow the example, since it is not necessary to look up
the signature of `stuff()` all the time. (it becomes manageable if you
read it as a sentence "is FPM")
LOL. That was completely unintentional. :-)
However, I have gone through and added numbers to the variable names to
clarify their original ordering.
I believe you missed some. I'm still seeing a bare `$i` and also a `$4p`
typo. Please double-check, possibly there are also other mistakes, I
didn't check in detail.
So the same is true of a PFA:
I don't think that necessarily follows, because for PFAs there are two
parameter lists that are relevant:
1. The parameter list of the resulting Closure.
2. The parameter list of the original function.
foo(a: ?, b: 2, c: ?);
foo(b: 2, a: ?, c: ?);
foo(c: ?, b: 2, a: ?);
foo(?, 2, ?);
All of those produce the same result.
I don't think they should. Specifically the (1) and (3) should not. My
expectation is that:
$f = foo(a: ?, b: 2, c: ?);
$f(1, 3); // calls foo(1, 2, 3);
and
$f = foo(c: ?, b: 2, a: ?);
$f(1, 3); // calls foo(3, 2, 1);
The order of the question marks should match the order of the parameters
in the resulting Closure, which is not necessarily the order of the
order parameters of the original function.
Best regards
Tim Düsterhus