The only reason I can think of to not do it this way is the weird distinction between structs and classes in D.
I have been learning D over the past three weeks and I came to
the chapter in "Programming in D" on Ranges. And I am a little
confused on the choice to make Ranges based on the methods you
have in the struct, but not use a interface. With all of the
isInputRange!R you have to write everywhere, it just seems like
it would have made a lot more sense and made everyone's jobs
easier if the different types of Ranges where just interfaces
that you could inherit from.
- Why aren't Ranges Interfaces? Jack Stouffer via Digitalmars-d-learn
- Re: Why aren't Ranges Interface... Adam D. Ruppe via Digitalmars-d-learn
- Re: Why aren't Ranges Inter... Jack Stouffer via Digitalmars-d-learn
- Re: Why aren't Ranges I... rsw0x via Digitalmars-d-learn
- Re: Why aren't Rang... Jack Stouffer via Digitalmars-d-learn
- Re: Why aren't Ranges I... Dicebot via Digitalmars-d-learn
- Re: Why aren't Ranges I... Justin Whear via Digitalmars-d-learn
- Re: Why aren't Ranges Interface... rsw0x via Digitalmars-d-learn
- Re: Why aren't Ranges Interface... Ali Çehreli via Digitalmars-d-learn