
Description


•

There are three forms of neutral operators: alphanumeric, symbol, and inert.


An alphanumeric neutral operator begins with an ampersand (&), followed by a letter or underscore, optionally followed by further letters, digits, or underscores.


A symbol neutral operator begins with an ampersand, followed by one of these special characters:

! " $ % & ' ( ) * + ,  . / : ; < = > ? @ [ \ ] ^ ` {  } ~




optionally followed by further characters from this set:

! " $ ) * + ,  . / < = > ? @ \ ] ^  } ~




An inert neutral operator begins with a percent symbol (%), and is followed by exactly one of these characters:

•

Alphanumeric and symbol neutral operators can be used as unary prefix operators, binary infix operators, or as function calls. They generate function calls, with the name of the function the same as the name of the neutral operator.

•

With the exception of &*, the alphanumeric and symbol neutral operators all have the same precedence. The &* operator has lower binding strength. For more information about the precedence of neutral operators in relation to other operators, see operators/precedence.

•

The inert neutral operators can only be used as binary infix operators. They have the same precedence as the corresponding operator without the % prefix.

•

Most binary neutral operators are leftassociative, except those beginning with two ampersands (&&), which are rightassociative, and the %^ operator, which is nonassociative.

•

Maple imposes no semantics on the neutral operators. The user may:

–

define manipulations on expressions containing such operators via Maple's interface to userdefined procedures for various standard library functions, including simplify, diff, series, evalf, expand, and so on. (See the help pages for the appropriate library functions.)

–

write procedures with the same names as the neutral operators, in which case expressions using those operators will invoke the procedures.

–

write modules exporting procedures with the same names as the operators, and then bring these operations into scope with use, uses, or with.


Note: Because ~ is a valid character in a symbol neutral operator, such an operator ending in ~ is not interpreted as an elementwise operator (see operators/elementwise). To apply a symbol neutral operator elementwise, a space is required before the ~.


Note: The inert neutral operators and some symbol neutral operators are currently not supported in 2D input in the Standard interface. For more information on which ones, see the Neutral Operators section of updates/Maple2019/Language.



Examples


>

$a\phantom{\rule[0.0ex]{0.3em}{0.0ex}}\&*\phantom{\rule[0.0ex]{0.3em}{0.0ex}}b$

${a}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\&*}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{b}$
 (1) 
Neutral operators have higher precedence than other operators.
>

$ab\phantom{\rule[0.0ex]{0.3em}{0.0ex}}\&+\phantom{\rule[0.0ex]{0.3em}{0.0ex}}c$

${a}{}{b}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\&+}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{c}$
 (2) 
All neutral operators except &* and those beginning with % have the same precedence.
>

$\left(a\phantom{\rule[0.0ex]{0.3em}{0.0ex}}\&\phantom{\rule[0.0ex]{0.3em}{0.0ex}}b\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}\&/\phantom{\rule[0.0ex]{0.3em}{0.0ex}}c$

$\left({a}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\&}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{b}\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\&/}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{c}$
 (3) 
>

$\mathrm{`\%`}\left(a\,\mathrm{`\%/`}\left(b\,c\right)\right)$

Neutral operators can be used in functioncall form.
>

$\mathrm{`\&`}\left(a\,b\,c\,d\right)$

${\mathrm{\&}}{}\left({a}{\,}{b}{\,}{c}{\,}{d}\right)$
 (5) 
>

$a\phantom{\rule[0.0ex]{0.3em}{0.0ex}}\&xx\phantom{\rule[0.0ex]{0.3em}{0.0ex}}ba\phantom{\rule[0.0ex]{0.3em}{0.0ex}}\&xx\phantom{\rule[0.0ex]{0.3em}{0.0ex}}b$

Neutral operators beginning with && are rightassociative.
${a}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\&\&}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}\left({b}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\&\&/}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{c}\right)$
 (7) 
A space is needed before the ~ to apply a neutral operator elementwise.
$\left[{a}{\,}{b}{\,}{c}\right]\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\&*\u02dc}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}\left[{d}{\,}{e}{\,}{f}\right]$
 (8) 
$\left[{a}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\&*}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{d}{\,}{b}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\&*}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{e}{\,}{c}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{\&*}\phantom{\rule[0.0ex]{0.3em}{0.0ex}}{f}\right]$
 (9) 
Defining a procedure with the same name as a neutral operator allows the introduction of userdefined prefix and infix operators.
>

`&str` := proc( ) cat("",_passed) end proc:

>

$\left(a\phantom{\rule[0.0ex]{0.3em}{0.0ex}}\&str\phantom{\rule[0.0ex]{0.3em}{0.0ex}}b\right)\phantom{\rule[0.0ex]{0.3em}{0.0ex}}\&str\phantom{\rule[0.0ex]{0.3em}{0.0ex}}c$



