2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2015-01-02 22:44:21 +00:00
|
|
|
macro_rules! print_hd_tl {
|
2013-06-27 23:53:40 +00:00
|
|
|
($field_hd:ident, $($field_tl:ident),+) => ({
|
2014-01-09 10:06:55 +00:00
|
|
|
print!("{}", stringify!($field_hd));
|
|
|
|
print!("::[");
|
2013-06-27 23:53:40 +00:00
|
|
|
$(
|
2014-01-09 10:06:55 +00:00
|
|
|
print!("{}", stringify!($field_tl));
|
|
|
|
print!(", ");
|
2013-06-27 23:53:40 +00:00
|
|
|
)+
|
2015-09-20 10:35:08 +00:00
|
|
|
print!("]\n");
|
2013-06-27 23:53:40 +00:00
|
|
|
})
|
2015-01-02 22:44:21 +00:00
|
|
|
}
|
2013-06-27 23:53:40 +00:00
|
|
|
|
2013-09-25 07:43:37 +00:00
|
|
|
pub fn main() {
|
2013-06-27 23:53:40 +00:00
|
|
|
print_hd_tl!(x, y, z, w)
|
|
|
|
}
|