DIP 1030--Named Arguments--Community Review Round 1 Discussion
Walter Bright
newshound2 at digitalmars.com
Tue Feb 11 07:04:34 UTC 2020
On 2/10/2020 3:20 PM, Jonathan Marler wrote:
> I took a quick look at std.math in phobos to see what some of the current
> argument names are:
>
> auto conj(Num)(Num z) @safe pure nothrow @nogc
> auto abs(Num)(Num x) @nogc pure nothrow
> real cos(real x) @safe pure nothrow @nogc { pragma(inline, true); return
> core.math.cos(x); }
> auto sin(creal z) @safe pure nothrow @nogc
> auto sin(ireal y) @safe pure nothrow @nogc
>
> So we have some of this:
>
> conj(z:someValue);
> abs(x:someValue);
> sin(y:someValue);
>
> Now that parameter names are apart of the function's API, this inconsistency
> starts to matter
It isn't inconsistent. In math, z=x+iy is normal notation, i.e. x for real
numbers, y for imaginary, and z for complex.
Besides, I doubt there's much of any point for using named parameters for those
functions.
More information about the Digitalmars-d
mailing list