Macro enso_shapely::replace [−][src]
macro_rules! replace { ($a:tt,$($b:tt)*) => { ... }; }
Expand description
Replaces the first argument with the second one. It is useful when creating macros which match
a pattern and you want to generate as many repetitions of a token as there was matches. For
example, when matching $($name:ident)*
, you may want to generate as many empty tuples as
the number of names matched. You can do it by using $(replace!{$name,()})*
.