Mark J. Reed wrote: > Jon Lang wrote: > > Those don't strike me as being unary operators; they strike me as > > being function calls that have left out the parentheses. > > At least through Perl5, 'tain't no difference between those two in Perl land.
True enough - though the question at hand includes whether or not there should be. Perhaps a distinction should be made between prefix and postfix. After all, postfix already forbids whitespace. True, the original reason for doing so was to distinguish between infix and postfix; but it tends to carry the implication that postfix operators are kind of like method calls, while prefix operators arekind of like function calls. Personally, I'd like to keep that parallel as much as possible. Unless it can be shown to be unreasonable to do so. :) > As for binary !, you could say posit that the second operand is the > degree of multifactorialhood, defaulting to 1; e.g. x!2 for what > mathematicians would write as x‼, which definitely does not mean > (x!)!. Wouldn't that be "x ! 2"? Mandatory whitespace (last I checked), since infix:<!> had better not replace postfix:<!>. > Oh, and I've always mentally filed -x as shorthand for (-1*x); of > course, that's an infinitely recursive definition unless -1 is its own > token rather than '-' applied to '1'. It's also only guaranteed to work if x is numeric; even in math, that's not certain to be the case. :) -- Jonathan "Dataweaver" Lang