Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - fix(init/core): lower precedence of unary - #287

Closed

Conversation

rwbarton
Copy link
Contributor

This commit moves the precedence of unary - below that of ^
so that -a^n parses as -(a^n) and not (as formerly) (-a)^n.

It would be reasonable to move - below * as well (so that
-a*b parses as -(a*b)) but this is surprisingly disruptive
to mathlib, because and have the same precedence as *
and - is also used for set complement. So, at least for now,
we leave the relative precedence of - and * unchanged.

This commit moves the precedence of unary `-` below that of `^`
so that `-a^n` parses as `-(a^n)` and not (as formerly) `(-a)^n`.

It would be reasonable to move `-` below `*` as well (so that
`-a*b` parses as `-(a*b)`) but this is surprisingly disruptive
to mathlib, because `∩` and `⊓` have the same precedence as `*`
and `-` is also used for set complement. So, at least for now,
we leave the relative precedence of `-` and `*` unchanged.
@gebner
Copy link
Member

gebner commented Jun 2, 2020

bors merge

bors bot pushed a commit that referenced this pull request Jun 2, 2020
This commit moves the precedence of unary `-` below that of `^`
so that `-a^n` parses as `-(a^n)` and not (as formerly) `(-a)^n`.

It would be reasonable to move `-` below `*` as well (so that
`-a*b` parses as `-(a*b)`) but this is surprisingly disruptive
to mathlib, because `∩` and `⊓` have the same precedence as `*`
and `-` is also used for set complement. So, at least for now,
we leave the relative precedence of `-` and `*` unchanged.
@bors
Copy link

bors bot commented Jun 2, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title fix(init/core): lower precedence of unary - [Merged by Bors] - fix(init/core): lower precedence of unary - Jun 2, 2020
@bors bors bot closed this Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants