News for hackers. Stuff that matters.
Re:Zig-style generics are not well-suited for most languages by valenterry on Monday October 10, 2022 @01:36AM (#33148133)
I wasn't talking about recursion but composition. Can I write template A and then apply it to itself to get template B and then apply that onto template C to get template D.
Re:Zig-style generics are not well-suited for most languages by WalterBright on Monday October 10, 2022 @02:07AM (#33148301)
Yes.
Re:Zig-style generics are not well-suited for most languages by valenterry on Monday October 10, 2022 @09:12PM (#33158302)
I can't quite wrap my head around how that would work, but I'll trust you and then take my original claim back!
Re:Zig-style generics are not well-suited for most languages by he_the_great on Saturday October 15, 2022 @12:02PM (#33215937)
auto alist = [1, 3, 2];

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.