On Mon, Sep 11, 2023 at 07:59:37PM +0000, ryuukk_ via Digitalmars-d-learn wrote: [...] > Recent version of D added named arguments so you can do something > like: > > ```D > void someFunction(Options option = Options(silenceErrors: false)) > ``` > > I don't like the useless repeating "option option option", but that's > D for you
Someone should seriously come up with a way of eliminating the repeated type name in default parameters. It's a constant fly in my otherwise tasty soup of D. Every time I have to type that I think about how nice it would be if we could just write void someFunction(Options option = .init) {...} and be done with it. Or else: void someFunction(auto options = Options.init) {} though this is not as good because the `auto` may make it hard to parse function declarations. T -- Life would be easier if I had the source code. -- YHL