mixin identifiers concept
mesni
mensikovk817 at gmail.com
Sat Jan 29 21:24:09 UTC 2022
```d
static foreach(name; ["boo", "foo"]){
string file_#name = readText(name~".txt");
string file_#name#_info = readText(name~".meta");
auto ##name = file_#name#_info.parseInfoFile;
}
writeln(file_boo);
writeln(boo);
writeln(file_foo_info);
```
To make it easier to read/write code in D, I would introduce new
mixins. These mixins can only represent identifiers. Also, the
advantage of such mixins, the parser and semantic analysis will
be able to detect some errors before the code is completely
"opened". Also, I think they can speed up compilation.
More information about the Digitalmars-d
mailing list