Skip to content

Instantly share code, notes, and snippets.

@JarrettBillingsley
Created December 16, 2013 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JarrettBillingsley/7985135 to your computer and use it in GitHub Desktop.
Save JarrettBillingsley/7985135 to your computer and use it in GitHub Desktop.
macro_rules! vertex_format_inner
(
(($a: expr, $b: expr), $(($a_rest: expr, $b_rest: expr)),+) =>
(
($a, $b), vertex_format_inner!($(($a_rest, $b_rest)),*)
);
(($a: expr, $b: expr)) =>
(
($a, $b)
)
)
macro_rules! vertex_format
(
($(($a: expr, $b: expr)),+) =>
(
~[vertex_format_inner!($(($a, $b)),+)]
)
)
fn main()
{
vertex_format!(
(1, 2), (3, 4)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment