Compile-time fold expression vs recursive template

Stefan Koch uplink.coder at googlemail.com
Fri Jun 19 17:36:54 UTC 2020


On Friday, 19 June 2020 at 17:04:57 UTC, Nick Treleaven wrote:
> On Saturday, 13 June 2020 at 12:35:58 UTC, Paul Backus wrote:
>> [...]
>
> I realized my FoldExpression feature invented too much syntax. 
> Really all we need is a way to limit what a template can do, 
> i.e. (1) not cache instantiations and (2) not declare symbols 
> (aside from eponymous symbols) so it can share a single Scope 
> instance in dmd. That Scope instance would be reused upon each 
> recursion, and only one recursion is allowed in each inner 
> `static if` branch. That could be done just by recognizing a 
> special identifer __Fold:
>
> [...]

We should talk and band together.
Multiple competing proposals won't help here.

We at least have gained some clarity about the problem.
Now let's gain some clarity about the solution space.



More information about the Digitalmars-d mailing list