[][src]Macro array_lit::arr

macro_rules! arr {
    [default: $def:expr $(, $idx:tt : $sparse:expr )* ; $len:expr] => { ... };
    [$( $item:expr ),* ; default: $def:expr $(, $idx:tt : $sparse:expr )* ; $len:expr] => { ... };
    [$item:expr ; $len:expr] => { ... };
    [$( $item:expr ),*] => { ... };
    [$( $item:expr, )*] => { ... };
}

A macro for array literals with superpowers.

See the module level documentation for more.

Example

 let a = arr![1, 2; default: 1, 4: 0; 5];
 assert_eq!(a, [1, 2, 1, 1, 0]);