PrecedenceForm

PrecedenceForm[expr,prec]

prints with expr parenthesized as it would be if it contained an operator with precedence prec.

Details

  • prec must be an integer. See notes for Infix.

Examples

open allclose all

Basic Examples  (1)

Force parenthesization by lowering the effective precedence of multiplication:

Scope  (1)

Define an operator |> using Infix:

Give the operator precedence higher than Plus but lower than Times:

Give the operator precedence higher than both Plus and Times:

Give the operator lowest precedence:

Introduced in 1988
 (1.0)