New in C#4

Bill Baxter wbaxter at gmail.com
Wed Oct 29 12:17:09 PDT 2008


On Thu, Oct 30, 2008 at 12:18 AM, dsimcha <dsimcha at yahoo.com> wrote:
> == Quote from bearophile (bearophileHUGS at lycos.com)'s article
>> They have used colons:
>> foo(x: 1, z: 3)
>> While Python uses equal signs:
>> foo(x=1, z=3)
>> I think they are about equally readable.
>> (I think there's a problem with named arguments, that you can solve in some
> ways, for example with an extra hidden bitfield argument that encodes what
> arguments are given and what not).
>> Bye,
>> bearophile
>
> Vote++ for named arguments.  I've been meaning to bring this up for a while.
> Given that it's a pure syntactic sugar feature and therefore shouldn't cause any
> significant ripple effects (at least none that I'm aware of) and greatly
> simplifies design and use of APIs with lots of optional parameters, I think it's a
> no brainer.

I think it would be nice, but it has come up a few times in the past,
and never got much traction.

--bb



More information about the Digitalmars-d mailing list