DIP 88: Simple form of named parameters

Dejan Lekic via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 23 11:05:46 PST 2016


On Saturday, 23 January 2016 at 14:19:03 UTC, Jacob Carlborg 
wrote:
> This is mostly to prevent ugly hacks like Flag [1].
>
> http://wiki.dlang.org/DIP88
>
> [1] https://dlang.org/phobos/std_typecons.html#.Flag

I already see confusing code like:
foo(10, 20, width: ((big) ? 600 : 200), height: ((big) ? 800 : 
480));

I know many people, especially those who are coming from the 
Python world, want named parameters, but I am not entirely sure 
we want that in D.

I would rather use the Builder pattern instead, because that 
typically what people do with named parameters...



More information about the Digitalmars-d mailing list