Malcolm McLean said:
בת×ריך ×™×•× ×¨×‘×™×¢×™, 12 בספטמבר 2012 18:43:10 UTC+1, מ×ת Edward A. Falk:
You could have |x| syntax. That would look a bit more mathematical.
I doubt that it would be possible to add that syntax without
conflicting with the existing "|" and "||" operators. I'm nearly
certain that it would, at the very least, cause confusion.
There's no reason you couldn't add new operators whose symbols happen
to be keywords. "sizeof", at least when applied to an expression,
is a unary operator like "-", "~", or "!".
For example, a "min" operator might have the syntax `x min y`.
To apply it to multiple values, just write `x min y min z`, which
would be equivalent to `(x min y) min z`. "abs" could be a unary
operator rather than a built-in function; in that case, both `abs x`
and `abs(x)` would be valid.
Presumably the new keywords would have to be something like _Abs,
_Min, and _Max, with a new header defining appropriate macros.
I'm not necessarily saying these *should* be added to the language,
just speculating about a way it could be done.