super-seq-macro 0.3.8

Macro to repeat a fragment of code based on a RHAI expression
Documentation

Supercharged seq! macro

This crate provides a seq! macro to repeat a fragment of source code and substitute into each repetition a value of your choosing, drawn from an iterable RHAI expression.

This is a fork of the seq-macro crate and is backwards-compatible for simple usage.

use super_seq_macro::seq;

seq!(A in 0..3 {#(
    const WITHOUT_~A: [u32; 2] = seq!(B in (0..3).collect().filter(|x| x != A) {
        [ #( B, )* ]
    });
)*});

assert_eq!(WITHOUT_0, [1, 2]);
assert_eq!(WITHOUT_1, [0, 2]);
assert_eq!(WITHOUT_2, [0, 1]);

License