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