| Crates.io | super-seq-macro |
| lib.rs | super-seq-macro |
| version | 0.3.8 |
| created_at | 2025-02-03 22:22:10.815501+00 |
| updated_at | 2025-02-10 21:57:23.273914+00 |
| description | Macro to repeat a fragment of code based on a RHAI expression |
| homepage | |
| repository | https://github.com/ervanalb/seq-macro |
| max_upload_size | |
| id | 1541159 |
| size | 54,831 |
seq! macroThis 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]);