std.d.lexer: pre-voting review / discussion

Jacob Carlborg doob at me.com
Wed Sep 11 23:49:52 PDT 2013


On 2013-09-12 00:02, H. S. Teoh wrote:

> Constructors with many arguments are evil, because you can't just modify
> one setting and use defaults for the rest; you have to specify all of
> them up to the last default argument you have to change.

Currently this is possible:

LexerConfig config = { iterStyle: IterationStyle.everything, tokenStyle: 
TokenStyle.source };

I would really like the following to be possible as well:

void foo (LexerConfig config);

foo({ iterStyle: IterationStyle.everything, tokenStyle: 
TokenStyle.source });

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list