Remix.run Logo
1718627440 a day ago

> struct Tag { ... } Tag;

What's the thing with the syntax? If you don't intend to use the type elsewhere don't give it a tag, if you want, you have to give it a name. (Assuming you are annoyed by the duplicate Tag)

WalterBright 3 hours ago | parent [-]

Which would you prefer:

    struct Tag { ... }
or:

    typedef struct Tag { ... } Tag;
? It's just simpler and easier to write code in D than in C/C++. For another example, in C/C++:

    int foo();
    int bar() { return foo(); }
    int foo() { return 3; }
The D equivalent:

    int bar() { return foo(); }
    int foo() { return 3; }