▲ 28 ▼ Introducing crabtime, a novel way to write Rust macros (ferrisoft.com) submitted 9 months ago by SorteKanin@feddit.dk to c/rust@programming.dev 5 comments fedilink hide all child comments
[–] SorteKanin@feddit.dk [S] 2 points 9 months ago (1 child) Not nearly as readable though permalink fedilink source parent hideshow 1 child comment replies: [–] MoSal@programming.dev 4 points 9 months ago It was just a quick solution showing how to do it with one macro and zero dependencies, utilizing the power of meta variables. It probably can be made nicer. Side Note: It's not directly relevant/needed here, but this also shows that maybe a theoretical $reverse{} meta variable can be useful with repeated patterns, to in this case generate the variants in the expected order. permalink fedilink source parent
[–] MoSal@programming.dev 4 points 9 months ago It was just a quick solution showing how to do it with one macro and zero dependencies, utilizing the power of meta variables. It probably can be made nicer. Side Note: It's not directly relevant/needed here, but this also shows that maybe a theoretical $reverse{} meta variable can be useful with repeated patterns, to in this case generate the variants in the expected order. permalink fedilink source parent