How templates work (bonus) - Full instantiation of Iota!(1,5)

Stefan Koch uplink.coder at googlemail.com
Thu Jun 4 12:44:30 UTC 2020


On Thursday, 4 June 2020 at 12:34:14 UTC, Simen Kjærås wrote:
> On Thursday, 4 June 2020 at 12:08:58 UTC, Stefan Koch wrote:
>>> [...]
>
> More:
> This line is missing a trailing parenthesis:
>     }.Iota => (3, Seq!(4, Seq!())
> This line has an extra trailing parenthesis:
>     }.Seq => (3, Seq!(4, Seq())))
> This line has an extra trailing parenthesis:
>     }.Seq => (1, Seq!(2, Seq!(3, Seq(4, Seq!())))))
> This line is missing some starting parentheses (Seq!3 and 
> Seq!4), and has an extra trailing one:
>     }.Iota => (1, Seq!(2, Seq!3, Seq!4, Seq!()))))))
>
> [...]

Wow That's amazing.
You found them all. (All I put it deliberately ;) and more)

Your expansion also looks much nicer.
Although it does not quite reflect the order in which it happens 
it helps explaining.

Did  you do them by hand as well or did you use a script?


More information about the Digitalmars-d mailing list