Closed light-matters closed 5 months ago
I've realised that this can be solved quickly (but probably not ideally) by writing a Wolfram function
WolframiteSubtract[xs__] :=
Module[{output = Map[Minus[#] &, List[xs]]},
If[Length@output != 1, output[[1]] = Minus@output[[1]]];
Apply[Plus, output]
]
and then aliasing to this function. This feels like a very slow solution, but the principal is there.
Currently, our aliases are simple 1 for 1 substitution, so there is no place to put the conditional logic w.r.t. number of arguments. Thus we'd either need to extend that, or go the Wolfram extension way.
(- 5 4) -> Subtract[5,4] (fine) (- 5) -> Subtract[5] (error) (- 5 4 3) -> Subtract[5, 4, 3] (error)
(- 5) should go to 'Minus[5]' (- 5 4 3) should go to Plus[5, -4, -3]?