digitalmars.D.learn - GDC and DMD incompatability, can both be used?
- cy (7/7) Jul 10 2020 hunt/source/hunt/serialization/JsonSerializer.d:125:20: error:
- cy (5/5) Jul 10 2020 And OK yes I see gdc definitely does not support static foreach,
- H. S. Teoh (10/17) Jul 10 2020 Which version of GDC are you using? Static foreach is a relatively new
- Adam D. Ruppe (7/10) Jul 11 2020 The word "static" there can probably be removed and have it work
hunt/source/hunt/serialization/JsonSerializer.d:125:20: error:
basic type expected, not foreach
125 | static foreach (string member;
FieldNameTuple!T) {
I'm having a little trouble using the hunt library with gdc. Does
gdc not support static foreach at all? Is there some way to write
code that it can understand, which does the same thing?
Jul 10 2020
And OK yes I see gdc definitely does not support static foreach, but instead there's some sort of D compiler written in D compiled by GDC? That's just dmd, isn't it? https://github.com/D-Programming-GDC/GDC/pull/550 He calls it "DDMD."
Jul 10 2020
On Sat, Jul 11, 2020 at 04:28:32AM +0000, cy via Digitalmars-d-learn wrote:
hunt/source/hunt/serialization/JsonSerializer.d:125:20: error: basic
type expected, not foreach
125 | static foreach (string member; FieldNameTuple!T) {
I'm having a little trouble using the hunt library with gdc. Does gdc
not support static foreach at all? Is there some way to write code
that it can understand, which does the same thing?
Which version of GDC are you using? Static foreach is a relatively new
feature, and GDC may not have picked it up yet.
GDC uses exactly the same front end as DMD (and LDC), so there is no
fundamental incompatibility. The only issue is that GDC is tied to the
GCC release cycle, so it may be a few releases behind DMD, and therefore
lack some newer features. Eventually it will catch up, though.
T
--
When solving a problem, take care that you do not become part of the problem.
Jul 10 2020
On Saturday, 11 July 2020 at 04:28:32 UTC, cy wrote:125 | static foreach (string member; FieldNameTuple!T) {The word "static" there can probably be removed and have it work exactly the same way. Worth a try.Does gdc not support static foreach at all?only the newest gdc does, version 10. version 9, in most package managers, doesn't include it. but if it is inside a function, normal foreach does the same thing anyway.
Jul 11 2020









cy <dlang verge.info.tm> 