Thread overview | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
March 30, 2018 [Issue 18698] static foreach + __traits(allMembers, moduleName) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18698 --- Comment #1 from Manu <turkeyman@gmail.com> --- I try this: module test; alias Members = __traits(allMembers, test); > Error: basic type expected, not `__traits` We *really* need to fix that one... So: module test; import std.meta; alias Members = AliasSeq!(__traits(allMembers, test)); pragma(msg, Members); > tuple("object", "std", "arr", "t", "Members") Okay, that's good. static foreach(m; Members) { pragma(msg, m); } Error: template instance AliasSeq!(__traits(allMembers, test)) recursive template expansion Oh dear... -- |
March 31, 2018 [Issue 18698] static foreach + __traits(allMembers, moduleName) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18698 Ketmar Dark <ketmar@ketmar.no-ip.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ketmar@ketmar.no-ip.org --- Comment #2 from Ketmar Dark <ketmar@ketmar.no-ip.org> --- lol. another `static foreach` great feature: `allMembers` tries to expand `static foreach`, effectively executing it's body, whith calls `allMembers`, which tries to expand `static foreach`, effectively... -- |
April 01, 2018 [Issue 18698] static foreach + __traits(allMembers, moduleName) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18698 --- Comment #3 from Manu <turkeyman@gmail.com> --- I barely understood a word of that post. Point is, this used to work... I've been using this for almost 10 years to do a bunch of codegen for stuff in module scope. -- |
April 01, 2018 [Issue 18698] static foreach + __traits(allMembers, moduleName) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18698 greenify <greeenify@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |greeenify@gmail.com --- Comment #4 from greenify <greeenify@gmail.com> --- Static foreach has been added in summer 2017 - how could you have been using this for ten years? (if this really is a regression, please describe it better so that everyone understands it. Otherwise I think ketmar's assessment of this being an oversight when static foreach was added. -- |
April 01, 2018 [Issue 18698] static foreach + __traits(allMembers, moduleName) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18698 --- Comment #5 from Ketmar Dark <ketmar@ketmar.no-ip.org> --- [i]>I've been using this for almost 10 years[/i] static foreach? so you really have a time machine, or a specially-crafted compiler version you never gave others?! please, can you show us the 10 yo code with `static foreach`, and the 10 yo old compiler you used to compile it? this is normal thing for new language feature: some cases are missed. it will eventually be fixed, and in the meantime you can write the code like us, mere mortals did for those 10 years: without `static foreach`. -- |
April 01, 2018 [Issue 18698] static foreach + __traits(allMembers, moduleName) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18698 --- Comment #6 from Manu <turkeyman@gmail.com> --- I used 'foreach', which doesn't work anymore. Since static foreach was added, the non-static one doesn't work the same. static foreach should to all the static stuff that foreach used to do. -- |
April 01, 2018 [Issue 18698] static foreach + __traits(allMembers, moduleName) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18698 --- Comment #7 from Ketmar Dark <ketmar@ketmar.no-ip.org> --- `foreach` never worked at the top level. and non-static forach works *exactly* the same as before. you are clearly has a very different compiler than the rest of us. -- |
April 01, 2018 [Issue 18698] static foreach + __traits(allMembers, moduleName) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18698 --- Comment #8 from Manu <turkeyman@gmail.com> --- Non-static foreach doesn't seem to be the same. There are new errors with old usage of foreach instructing to use static foreach instead. And it definitely worked at top level. I was using it to generate top level binding stub functions almost as long as I've been using D. It would be inside a mixin template mixed in at top level, that's all. -- |
April 01, 2018 [Issue 18698] static foreach + __traits(allMembers, moduleName) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18698 --- Comment #9 from Ketmar Dark <ketmar@ketmar.no-ip.org> --- >Non-static foreach doesn't seem to be the same. example, please. *nothing* was changed in old foreach. >And it definitely worked at top level. example, please. i have several different compiler versions at hand, starting from 2.073 (WAY before static foreach), and top-level foreach doesn't work in all of them. please, give example code and compiler version where it worked. thank you. -- |
April 01, 2018 [Issue 18698] static foreach + __traits(allMembers, moduleName) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18698 --- Comment #10 from Manu <turkeyman@gmail.com> --- Remove the 'static' from my OP and you have it. It definitely worked. They flew me to dconf in 2013 and I gave a whole lecture about it. I don't work there anymore, so I don't have the code. I was starting to write a new version. Emitting an error instructing me to insert 'static' is at least once change in old foreach. -- |
Copyright © 1999-2021 by the D Language Foundation