D2 Closure

Michel Fortin michel.fortin at michelf.com
Thu Feb 18 11:33:02 PST 2010


On 2010-02-18 12:18:47 -0500, Martin Franklin 
<martin246564 at btinternet.com> said:

> Its time to dump C-like languages - I have the evidence.
> 
> http://www.modulaware.com/mdlt28.htm

Nice read... and it gives me a new feature idea for D! The article 
rants about default parameters not being very useful when you have more 
than one (something I agree with), then propose an improvement:

> Furthermore, they do not provide a great deal of convenience. If a 
> routine has five parameters, the last three of which are optional, and 
> caller wants to assume the defaults for parameters 3 and 4, but must 
> specify parameter 5, then all five parameters must be specified. A 
> better scheme would be to have a default keyword in function calls:
> 
> f (a, b, default, default, e);

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.


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list