gensym

Crates.iogensym
lib.rsgensym
version0.1.1
sourcesrc
created_at2019-01-19 18:18:26.154298
updated_at2023-08-05 21:28:09.212535
descriptionCreates unique identifiers for macros using procedural macros
homepage
repositoryhttps://github.com/regiontog/gensym
max_upload_size
id109553
size19,354
Erlend Tobiassen (regiontog)

documentation

https://docs.rs/gensym/latest/gensym/

README

Crates.io Rust Documentation

gensym

Creates unique identifiers for macros using procedural macros and UUID

Examples


macro_rules! gen_fn {
    ($a:ty, $b:ty) => {
        gensym::gensym!{ _gen_fn!{ $a, $b } }
    };
}

macro_rules! _gen_fn {
    ($gensym:ident, $a:ty, $b:ty) => {
        fn $gensym(a: $a, b: $b) {
            unimplemented!()
        }
    };
}

mod test {
    gen_fn!{ u64, u64 }
    gen_fn!{ u64, u64 }
}
Commit count: 14

cargo fmt