Macro immense::tf

source ·
macro_rules! tf {
    ($($transform:expr),+ $(,)*) => { ... };
}
Expand description

An ergonomics macro for listing transforms that will apply in order and branch on replications.

Where normally you would have to write

let transforms_with_a_replication = vec![Replicate::n(1, Tf::tx(2.0)),
                                         Replicate::n(3, Tf::ty(1.0))];

you can write

let transforms_with_a_replication = tf![Tf::tx(2.0), Replicate::n(3, Tf::ty(1.0))];

and the branching of transforms will be the same. Both these when passed to a rule invocation will invoke a rule twice, applying Tf::tx(2.0) and Tf::ty(1.0) to the first invocation, and Tf::tx(2.0) and Tf::ty(2.0) to the second invocation.