From 15008182250908f6a60e537826e9872b44446dd1 Mon Sep 17 00:00:00 2001 From: Thomas Guillermo Albers Raviola Date: Tue, 28 Jul 2026 19:59:01 +0200 Subject: Add ensure_list --- tensors.mac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tensors.mac b/tensors.mac index 6e9cf8d..2249b0d 100644 --- a/tensors.mac +++ b/tensors.mac @@ -22,3 +22,5 @@ box_op(func) := ( - contr(ug[μ,ν] * mcs[μ,ν,ρ] * cdiff(func, ρ), [μ,ν,ρ])))$ mappend(f, list) := apply(append, map(f, list)); + +ensure_list(x) := if listp(x) then x else [x]; -- cgit v1.3