Macro seq::seqdef
[−]
[src]
macro_rules! seqdef { ($id:ident; $ft:expr ) => { ... }; ($id:ident; $ft0:expr, $($ftn:expr),* ) => { ... }; ($id:ident; $rt:expr => $ft:expr ) => { ... }; ($id:ident; $rt:expr => $ft0:expr, $($ftn:expr),* ) => { ... }; }
The seqdef! macro defines a stack-allocated sequence variable for the speficied data list, the last data item in the list will be the top most in the sequence.
Example 1) Creating a seq variable s where 2 is the top most data item
seqdef!(s; seq::empty() => 0, 1, 2);
Example 2) Creating a seq variable t without explicit seq::empty(). Seq is identical to s
.
seqdef!(t; 0, 1, 2);
Example 3) Creating a seq variable u, using Seq s
as tail of example 1.
seqdef!(u; &s => 3, 4, 5);