summaryrefslogtreecommitdiff
path: root/tensors.mac
diff options
context:
space:
mode:
authorThomas Guillermo Albers Raviola <thomas@thomaslabs.org>2026-07-28 19:59:01 +0200
committerThomas Guillermo Albers Raviola <thomas@thomaslabs.org>2026-07-28 19:59:01 +0200
commit15008182250908f6a60e537826e9872b44446dd1 (patch)
tree31c9232dc48262db45846e065917c3b1b4cb8f9b /tensors.mac
parent2e4a8e535ea7fcd65eabadaf424a56ef1297be61 (diff)
Add ensure_list
Diffstat (limited to 'tensors.mac')
-rw-r--r--tensors.mac2
1 files changed, 2 insertions, 0 deletions
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];