On Sat, 05 Apr 2014 21:26:17 -0400, Nick Sabalausky wrote: > I realize this isn't the time for such a thing to be added to D, but I > thought I'd put the idea out there, FWIW: > > I find myself frequently needing to design APIs that work like this: > > func( [optionalFoo], [optionalBar] ) > > Typically, that's not permitted in C-style languages, including D. They > only allow this: > > func( [optionalFoo, [optionalBar]] ) >
static structs can be initialized by name, maybe that syntax could be expanded upon? void foo( struct{ int a = 1; double b = 3.14; } ) { .. } ... foo( {b: 2} ); that or named tuples with an init value set?