1pub macro for_sequence {
9 ( $pattern:pat in ($($iter:expr),+) $do:block) => {
10 $(for $pattern in $iter $do)+
11 }
12}
13
14pub macro show {
16 ($e:expr) => {
17 println!("{}: {:?}", stringify!($e), $e);
18 }
19}
20
21pub macro eshow {
23 ($e:expr) => {
24 eprintln!("{}: {:?}", stringify!($e), $e);
25 }
26}
27
28pub macro pretty {
30 ($e:expr) => {
31 println!("{}: {:#?}", stringify!($e), $e);
32 }
33}
34
35pub macro epretty {
37 ($e:expr) => {
38 eprintln!("{}: {:#?}", stringify!($e), $e);
39 }
40}
41
42pub macro display {
44 ($e:expr) => {
45 println!("{}: {}", stringify!($e), $e);
46 }
47}
48
49pub macro edisplay {
51 ($e:expr) => {
52 eprintln!("{}: {}", stringify!($e), $e);
53 }
54}
55
56pub macro bits {
58 ($e:expr) => {
59 let e = $e;
60 println!("{}: {:02$b}", stringify!($e), e, 8 * core::mem::size_of_val (&e));
61 }
62}
63
64pub macro ebits {
66 ($e:expr) => {
67 let e = $e;
68 eprintln!("{}: {:02$b}", stringify!($e), e, 8 * core::mem::size_of_val (&e));
69 }
70}
71
72pub macro hex {
74 ($e:expr) => {
75 println!("{}: {:x}", stringify!($e), $e);
76 }
77}
78
79pub macro ehex {
81 ($e:expr) => {
82 println!("{}: {:x}", stringify!($e), $e);
83 }
84}
85
86pub macro address {
88 ($e:expr) => {
89 println!("{}: {:p}", stringify!($e), $e);
90 }
91}
92
93pub macro eaddress {
95 ($e:expr) => {
96 eprintln!("{}: {:p}", stringify!($e), $e);
97 }
98}