E.g. mytuple.0 can't be generated by mytuple.$num due to rust only accepting an identifier here. And digits ofc are expressions....
#![feature(macro_rules)]
macro_rules! nth(
($n:expr,$x:ident) => ($x.$n);
)
fn main(){
let foo = (2u, 3u, 4u);
let bar = nth!(2, foo);
}
E.g.
mytuple.0can't be generated bymytuple.$numdue to rust only accepting an identifier here. And digits ofc are expressions....Minimal Example: