New in C#4

Jarrett Billingsley jarrett.billingsley at gmail.com
Wed Oct 29 13:17:41 PDT 2008


On Wed, Oct 29, 2008 at 3:50 PM, bearophile <bearophileHUGS at lycos.com> wrote:
> Jarrett Billingsley:
>> Since it's getting resolved at compile time, no bitfield is necessary.
>
> When we have designed ShedSkin we have had to deal with named arguments too, including situations like:

Ooh, that's icky.  Well I'd argue then that in the equivalent in D:

float foo(float a, float b) { return a - b; }
float bar(float b, float a) { return a / b; }
auto fun = [&foo, &bar];
...
fun[0](a: 5, b: 3); // error

the last line would be an error only because function pointers are not
the same as functions, and their parameters do not have names.
Similar to how currently, a function pointer or delegate to a function
that takes optional parameters cannot be called the same way as the
original function.

Still, "only" being able to call functions directly while using
named/default parameters covers a _great_ majority of use cases.
Covering the rest seems to be wasting a lot of implementation time and
performance on something that most people honestly will not use that
much.



More information about the Digitalmars-d mailing list