DIP 88: Simple form of named parameters
tcak via Digitalmars-d
digitalmars-d at puremagic.com
Sat Jan 23 07:34:00 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
Without making things any complex, the simplest thought of mine
is:
Keep everything same. But allow caller to put name of parameter
front its value wherever desired.
Let's say,
Rect createRect(int x, int y, int width, int height);
So you could call it like:
createRect( 10, 20, width: 200, height: 500 );
More information about the Digitalmars-d
mailing list