macro_metavar_expr mentioned on page prior to saying there's "no direct way to do this"
I'm just reading through the book, and saw:
${count(ident)}: The number of times $ident repeats in the inner-most repetition in total.
on https://veykril.github.io/tlborm/decl-macros/macros-methodical.html
Then I go to the next page and it says:
Somehow turning inits into a literal 2 is a little trickier. It turns out that there's no direct way to do this, but we can do it by using a second macro_rules! macro.
Am I misunderstanding, or is there in fact a direct way if I use #![feature(macro_metavar_expr)] ?
Yes metavar expressions will make counting very easy, but as they aren't stable yet, one has to stick to the more cumbersome counting tricks for non nightly toolchains.