The way the TP currently generates the code for filling in holes of a template, temporary variables are created for every item because list appending happens in a flipped order
Solutions would be:
- delay generating quotation by the TP until the final
Doc()call - but as previous methods take expression arguments, that we should preserve, this might not work at all.
- apply a macro at the final .Doc call, to optimize this
- do a global optimizer that recognizes list creation by repeated :: operator and
letexpressions and flatten it to an array and use
List.ofArrayon it (as currently simple list expressions are translated)