GaloisInc / cryptol

Cryptol: The Language of Cryptography
https://galoisinc.github.io/cryptol/master/RefMan.html
BSD 3-Clause "New" or "Revised" License
1.14k stars 126 forks source link

Change default fixity to non-associative #676

Open brianhuffman opened 4 years ago

brianhuffman commented 4 years ago

Currently if you don't provide a Cryptol fixity declaration for an infix operator, you get infixl 100 (left-associative, high precedence) as a default. (Separate question: Is this documented anywhere?)

Perhaps it would be more natural for the default to be non-associative. This way we can be sure that the meaning of a program will never depend on the default associativity, as users will be forced to resolve any ambiguity with parentheses.

brianhuffman commented 4 years ago

Maybe we should print a warning if someone defines an infix operator and doesn't specify a fixity/associativity for it.

robdockins commented 3 years ago

I think a warning is a good idea.