symbols!() { /* proc-macro */ }Expand description
Procedural macro for creating multiple symbols at once
§Syntax
ⓘ
symbols![x, y, z] // All scalars (default)
symbols![A, B, C => matrix] // All matrices
symbols![p, x, H => operator] // All operators
symbols![i, j, k => quaternion] // All quaternions§Returns
Returns Vec<Symbol> containing all created symbols.
§Examples
ⓘ
use mathhook_macros::symbols;
// Scalar symbols (default, commutative)
let syms = symbols![x, y, z];
assert_eq!(syms.len(), 3);
// Matrix symbols (noncommutative)
let mats = symbols![A, B, C => matrix];
assert_eq!(mats.len(), 3);
// Operator symbols (noncommutative)
let ops = symbols![p, x, H => operator];
assert_eq!(ops.len(), 3);
// Quaternion symbols (noncommutative)
let quats = symbols![i, j, k => quaternion];
assert_eq!(quats.len(), 3);