D2 Closure

Jonathan M Davis jmdavisProg at gmail.com
Thu Feb 18 13:11:39 PST 2010


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



More information about the Digitalmars-d mailing list