<div dir="ltr"><div dir="ltr">On Sun, Jun 14, 2020 at 9:50 PM Nick Treleaven via Digitalmars-d <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Saturday, 13 June 2020 at 10:52:46 UTC, Nick Treleaven wrote:<br>
> Recently 2 ideas have been proposed to reduce the need for <br>
> recursive templates:<br>
<br>
The reason for these is that recursive template expansion is slow <br>
and can use a lot of memory which is never freed.<br>
<br>
> * A `Seq...` expression to expand inline a named sequence, or <br>
> an expression containing one or more named sequences.<br>
<br>
Sorry, this should've read: "`Expression...` to expand an <br>
expression containing one or more named sequences". Here's the <br>
DIP link:<br>
<a href="https://github.com/dlang/DIPs/blob/f9790ee6760b2d3cd0dbc1e816080c29c00c6dc2/DIPs/DIP10xx.md#add-unary-operator-" rel="noreferrer" target="_blank">https://github.com/dlang/DIPs/blob/f9790ee6760b2d3cd0dbc1e816080c29c00c6dc2/DIPs/DIP10xx.md#add-unary-operator-</a><br>
<br>
> This is essentially just a compiler intrinsic to perform the <br>
> std.meta.Map operation, so it cannot wholly implement the other <br>
> recursive templates in std.meta (though in some cases it may <br>
> help).<br>
<br>
Manu did propose a follow up to that would support a very basic <br>
fold expression, but it seems to be limited to using an operator <br>
between element expressions (no `static if`):<br>
<br>
>> Static reduce would allow `...` as an argument to a BinOp<br>
>> Ie; `Tup + ...` would expand `Tup[0] + Tup[1] + Tup[2] + ...`<br>
>> You could do `is(FindType == Tup) || ...`, and it would <br>
>> evaluate true if<br>
>> FindType exists in Tup, with no junk template instantiations!<br>
<br>
<a href="https://forum.dlang.org/post/mailman.2786.1587566241.31109.digitalmars-d@puremagic.com" rel="noreferrer" target="_blank">https://forum.dlang.org/post/mailman.2786.1587566241.31109.digitalmars-d@puremagic.com</a> <br></blockquote><div><br></div><div>It's implemented in my branch too if you wanna try it out! </div></div></div>