Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #[macro_export]
  2. macro_rules! separator {
  3. ($($x:tt)*) => { "/" };
  4. }
  5.  
  6. #[macro_export]
  7. macro_rules! concat_separator {
  8. ( $e:literal, $($other:literal),+ ) => {
  9. ($e, $crate::separator!(), $crate::concat_separator!($($other),+))
  10. };
  11. ( $e:literal ) => {
  12. $e
  13. }
  14. }
  15.  
  16. fn main() {
  17. println!("{:?}", concat_separator!(2, 3,4))
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement