On Tuesday, 23 April 2013 at 06:24:24 UTC, Mehrdad wrote:

The trouble is that you've already failed before you started.

Also, I'm assuming that this means that you had no intention of learning. That's kind of a poor position to be in, IMO. That means that I can't help you because you don't want to be helped.

So, I can give you appropriate alternatives (such as tuple) but you won't look at it and see "Oh, jeez, that's actually what I've been using structs for." (Or not, but I can't ever know that's not what you're looking for if you're not going to even try).

And I can't suggest snippets like:

    bool opEquals(T rhs) {
        foreach(i, e; this.tupleof) {
            if(!(e == rhs.tupleof[i]))
                return false;
        }
        return true;
    }

... Which you could use in a mixin to start building a framework of behaviors you can add to _any_ struct to automatically get the behavior you want. We also can't discuss adding this as an attribute using the new attribute system and adding it to the standard library which might be something cool.

No, we have to do it _your_ way and using _your_ understanding, instead of cooperating and getting a better result that we can both agree on.

All I'm saying is that structs are really basic for a reason. They're something you _build_ on. If you don't want to build on it (and you want something already somewhat built), you might be better served using something that _is_ prebuilt. Or make your own platform based on a struct (kinda like how tuples are implemented) and solve it that way.

So many solutions to your problem, yet you've already decided that changing the language is the only "right" way.

Reply via email to