John Williams wrote:
Good point. Another one is: how does the meta_operator determine the "identity value" for user-defined operators?
Does it have to? The definition of the identity value---BTW, I like the term "neutral value" better because identity also is a relation between two values---is that $x my_infix_op $neutral == $x.
One set of cases that doesn't seem to have come up in discussion:
(1, 3, 2) >>-<< (83, 84, 81, 80, 85)
Should this give
(-82, -81, -79, -80, -85)
as it would by hallucinating 0 (neither a left-identity nor left-neutral element for subtraction strictly, but at least a natural left pivot element), or
(-82, -81, -79, 80, 85)
as by hallucinating $neutral - $x == $x? This latter $neutral in fact doesn't exist among ordinary numbers, and I would call it algebraically unnatural: for all (other) $n,
$n - ($a + $b) == ($n - $a) - $b
or, as you increase $a by $b, $n - $a decreases by $b (a sort of contravariance), but
$neutral - ($a + $b) == $a + $b == ($neutral - $a) + $b
! This violates algebraic relations I would prefer to rely on, both in my own reasoning and that of the compiler and other program-handling programs.
Best regards Roger