digitalmars.D.learn - Does D 2.110 support named parameters?
- Brother Bill (19/19) Dec 05 Does D 2.110 support named parameters, and if so, what
- Richard (Rikki) Andrew Cattermole (15/15) Dec 05 It compiles with dmd 2.109.1 if other problems are solved.
- Brother Bill (5/21) Dec 05 The problem was using one name here and a different name there.
- Dom Disc (6/7) Dec 06 Unfortunately D-Scanner put out two "problems" for each use of
- Brother Bill (5/12) Dec 06 When using VS Code, the first "problem" is displayed.
- Dom Disc (6/10) Dec 06 Yes. It's only a little annoying as non-fixable "problems"
Does D 2.110 support named parameters, and if so, what
configuration is necessary,
such as -preview=all
The following code doesn't compile on Window 11.
Is there D syntax that does work?
```
void main() {
string[string] dictionary = [
"blue": "mavi", "red": "kırmızı", "gray": "gri"
];
}
// Want to have default keySeparator by ": "
printAA("Color Dictionary", aa, commaSeparator: "\n");
void printAA(string title, string[string] aa, string keySeparator
= ": ", string commaSeparator = ", ")
{
// ...
}
```
Dec 05
It compiles with dmd 2.109.1 if other problems are solved.
```d
void main() {
string[string] dictionary = [
"blue": "mavi",
"red": "kırmızı",
"gray": "gri"
];
printAA("Color Dictionary", dictionary, commaSeparator: "\n");
}
void printAA(string title, string[string] aa,
string keySeparator= ": ",
string commaSeparator = ", ") {
}
```
Dec 05
On Saturday, 6 December 2025 at 01:37:55 UTC, Richard (Rikki)
Andrew Cattermole wrote:
It compiles with dmd 2.109.1 if other problems are solved.
```d
void main() {
string[string] dictionary = [
"blue": "mavi",
"red": "kırmızı",
"gray": "gri"
];
printAA("Color Dictionary", dictionary, commaSeparator:
"\n");
}
void printAA(string title, string[string] aa,
string keySeparator= ": ",
string commaSeparator = ", ") {
}
```
The problem was using one name here and a different name there.
Thanks for looking at it.
Nothing special is needed for it to run.
Dec 05
On Saturday, 6 December 2025 at 01:37:55 UTC, Richard (Rikki) Andrew Cattermole wrote:It compiles with dmd 2.109.1 if other problems are solved.Unfortunately D-Scanner put out two "problems" for each use of named parameters :-( - Expected `)` instead of `:` - Primary expression expected
Dec 06
On Saturday, 6 December 2025 at 10:56:36 UTC, Dom Disc wrote:On Saturday, 6 December 2025 at 01:37:55 UTC, Richard (Rikki) Andrew Cattermole wrote:When using VS Code, the first "problem" is displayed. But the code does compile and run. Named parameters are sometimes quite helpful. This overcomes the D-Scanner "false alarms".It compiles with dmd 2.109.1 if other problems are solved.Unfortunately D-Scanner put out two "problems" for each use of named parameters :-( - Expected `)` instead of `:` - Primary expression expected
Dec 06
On Saturday, 6 December 2025 at 11:37:07 UTC, Brother Bill wrote:When using VS Code, the first "problem" is displayed. But the code does compile and run.Yes. It's only a little annoying as non-fixable "problems" degrades the value of this problem-list (e.g. have to look if problem count is non-zero is gone because it will always be non-zero).Named parameters are sometimes quite helpful. This overcomes the D-Scanner "false alarms".Yes.
Dec 06









Brother Bill <brotherbill mail.com> 