DIP 1030--Named Arguments--Community Review Round 1 Discussion

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Feb 10 18:36:08 UTC 2020


On Mon, Feb 10, 2020 at 01:27:49PM -0500, Steven Schveighoffer via Digitalmars-d wrote:
> On 2/6/20 10:33 PM, Jonathan M Davis wrote:
> > Once in a while, named arguments may be useful, but for the most
> > part, they're useful because a function has way too many parameters,
> > in which case, the function should have been designed differently.
> 
> I find this assertion lacking evidence.
> 
> How does one design a constructor that initializes all the fields of a
> type without including all the parameters to initialize that type?
[...]

Ostensibly, by encapsulating the parameters into a struct and passing
said struct up the ctor chain. ;-)


T

-- 
English has the lovely word "defenestrate", meaning "to execute by
throwing someone out a window", or more recently "to remove Windows from
a computer and replace it with something useful". :-) -- John Cowan


More information about the Digitalmars-d mailing list