D2 Closure

Jacob Carlborg doob at me.com
Thu Feb 18 14:25:26 PST 2010


On 2010-02-18 22.11, Jonathan M Davis wrote:
> Michel Fortin wrote:
>
>> Would't that be nice to be able to use the 'default' keyword when you
>> want to use the default value for a parameter? Should be pretty trivial
>> to implement.
>
> Except that to some extent, that would defeat the purpose of default
> parameters. Part of the idea is that you don't have to worry about their
> existence unless you actually want to change them. If you're going to have
> to put the word default there, then in many cases, you might as well just
> put an actual value yourself.
>
> The one thing that word default would give you would be the ability to
> choose the the default value for parameters in the middle of the parameter
> list and still give values for parameters at the end. But that's just extra
> complication and likely wouldn't be worth the benefit.
>
> - Jonathan M Davis

That sounds like named parameters, which could be nice to have.



More information about the Digitalmars-d mailing list