Skip to content

handling precedence and associativity in nested Infix expressions #1670

@mmatera

Description

@mmatera

Description

Associativity in Infix controls when parentheses must be added to a subexpression, when the precedence of the inner and the outer expressions are the same. Consider the following case:

'Infix[{a, Infix[{b,c},"#",300, Left]}, "@", 300, Right]'

The inner Infix expression is tagged as Left-associative, so it must be parenthesized if it is inside of another expression with the same precedence, and does not appear as the first argument.

In WMA we get

 a@(b#c)

while in Mathics3

 a@b#c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions