Re: kwargs v0.0.1 - Keyword arguments with strong types

2019-02-12 Thread Atila Neves via Digitalmars-d-announce
On Monday, 11 February 2019 at 22:32:59 UTC, Vladimir Marchevsky wrote: On Monday, 11 February 2019 at 17:03:36 UTC, Atila Neves wrote: import kwargs; struct Foo { string value; } struct Bar { string value; } struct Baz { string value; } size_t funImpl(in Foo foo, in Bar bar = Bar("lebar"), in

Re: kwargs v0.0.1 - Keyword arguments with strong types

2019-02-11 Thread Vladimir Marchevsky via Digitalmars-d-announce
On Monday, 11 February 2019 at 17:03:36 UTC, Atila Neves wrote: import kwargs; struct Foo { string value; } struct Bar { string value; } struct Baz { string value; } size_t funImpl(in Foo foo, in Bar bar = Bar("lebar"), in Baz baz = Baz("lebaz")) { return foo.value.length + bar.value.lengt

kwargs v0.0.1 - Keyword arguments with strong types

2019-02-11 Thread Atila Neves via Digitalmars-d-announce
https://code.dlang.org/packages/kwargs There have been many posts asking about keyword arguments for D a la Python. Usually I reply saying to just use the type system, but that has the incovenience of having to pass all 7 parameters before the optional 8th one you actually care about despite y