gfngfn / SATySFi

A statically-typed, functional typesetting system
GNU Lesser General Public License v3.0
1.16k stars 82 forks source link

Unusual operator associativity and precedence #299

Open leque opened 2 years ago

leque commented 2 years ago

In SATySFi, /, *, mod, and + are right associative, i.e. 4 / 2 / 2 = 4 / (2 / 2), not (4 / 2) / 2, thus evaluated to 4. In addition, + has lower precedence than -, so 1 + 2 - 3 = 1 + (2 - 3).

Is this a bug or intended behavior?

gfngfn commented 2 years ago

This is not intended, and it is desirable in my opinion that this be fixed when releasing v0.1.0.