https://dlang.org/spec/template.html#template_constraints
It's simple to implement and understand, as it doesn't introduce any new syntax, and people already know how to write conventional code.
https://dlang.org/spec/template.html#template_constraints
It's simple to implement and understand, as it doesn't introduce any new syntax, and people already know how to write conventional code.
That is indeed possible, but it's hard to see why that is a problem. Any problems would show up at compile time, and fixing errors flagged by the compiler is pretty routine programming work.
Templates work even in betterC mode.
I had someone explaining D templates to me on an Idris meetup, but it's been a few years, so I might very well be wrong here and not remember correctly. I'm happy to be corrected.
My next question would be: can I write those meta templates myself and modify them with themselves? In the same way that I could have a type-level function that applies another type-level function twice and then apply it on itself to get a new type-level function that applies another type-level function four times.
alist .sort .map!(x => x * x) .map!(x => x - x/2) .map!(x => x + 1);
This seems like what you're asking. Each of those is a template. And while this is all logic code, D has inferred the type aka: SortedRange!Map!Map!Map
With some details removed.