17 ms·
What you're describing has names - structural types, refined types (a.k.a. contracts a.k.a. pre- and post-conditions)... It's simply a failure of D the languag
by tomp 7y ago
What you're describing has names - structural types, refined types (a.k.a. contracts a.k.a. pre- and post-conditions)...
It's simply a failure of D the language/compiler (and a huge anti-pattern) to not expose internal types in a way that can be displayed to the programmer.
- FeepingCreature 7y agoNo such internal type exists. The range interface is purely a library feature. The problem is that D has no way to include a type constraint as a part of the function type, at present. Something like out template contracts would do it probably.
- guai- 7y agojava can't express its types in its own syntax either. nor scala, nor sharp. ceylon could, but they are barely readable anyway.