Skip to content

macro_metavar_expr mentioned on page prior to saying there's "no direct way to do this" #84

@jpmckinney

Description

@jpmckinney

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)] ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions