DIP 1020--Named Parameters--Community Review Round 1
jmh530
john.michael.hall at gmail.com
Mon Apr 1 21:11:36 UTC 2019
On Monday, 1 April 2019 at 19:41:25 UTC, bachmeier wrote:
> [snip]
> all evaluating to the same thing, and somehow the programmer is
> supposed to know that the 4 is mapped to the second argument in
> every call. This is the kind of thing that would make someone
> give up on D after just a few minutes. The only way it can work
> to rearrange the mapping of parameters from the function call
> to the function itself is if the parameter being moved is
> named. This is a simple example.
In R, if you have
f <- function(x, y, z) { x + 2*y + 3*z}
and call
f(z=1, 2, 3)
the result is 11.
I don't know if that's any easier or not, but I can definitely
see how people would find a lot of these examples confusing.
More information about the Digitalmars-d
mailing list