Format and Operators precedences #810
mmatera
started this conversation in
Show and tell
Replies: 1 comment 3 replies
-
The operators often need a "grouping" ("left associative", "right associative"). See:
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
From a discussion we have in #809, and #802, it came up that (among many other things) the use of the operators precedences in Mathics does not fulfills the WL standard (AKA the WMA behavior). Recently, I added the
PrecedenceForm
symbol to the builtin list, and started to provide some documentation. However, after the discussion in #809, I check more deeply the current behaviour in Mathics, and I discover that it does not matches with WMA. To bring it closer, I started the following branch:https://github.com/Mathics3/mathics-core/tree/infix_precedence_fix
which still does not pass the CI. Then, came up the following issues:
is formatted as
a => (b=> c)
in WMA, buta=>b=>c
in Mathics.Infix[Operands_List, operators_List, ... ]
does now works like in Mathics:produces in WMA
a {+,-} b {+,-} c
instead ofa + b - c
(Mathics behavior)Plus
andTimes
do not seem to have format rules, but justMakeBoxes
rules. This is related to another refactor that is in progress now, but maybe it is useful to be aware of this if we want to improve the compatibility using the current (internal) API.Beta Was this translation helpful? Give feedback.
All reactions