Nick Smith
07/13/2019, 10:39 AMKartik Agaram
PrimaryKey
and Guid
, and so on.
If this is true then maybe we can often disambiguate how arguments map to formal parameters based purely on type. The obvious examples where this breaks down are low level functions for say comparing two strings. In those cases if an operation is commutative then the mapping didn't matter. If it isn't commutative then we must fall back to ordered args. But maybe that shouldn't be the default. Positional arguments are the default only because that's easiest to implement.
Can anyone think of an example of a fairly platonic, low-level operation that needs to take more than two args where one is of a different type than the others? Then it would be harder to decide whether to switch to positional args or not. Ah, here's one:
bool is-substring?(string big, string small, int start)
I'm not sure what to do here.