Skip to content

[Merged by Bors] - fix: apply multiple ext-lemmas in a row - #370

Closed
gebner wants to merge 1 commit into
masterfrom
extbug
Closed

gebner wants to merge 1 commit into
masterfrom
extbug

Conversation

@gebner

@gebner gebner commented Aug 18, 2022 •

Copy link
Copy Markdown
Member

No description provided.

Comment thread Mathlib/Tactic/Ext.lean
| `(tactic| ext_or_skip) => `(tactic| repeat apply_ext_lemma)
| `(tactic| ext_or_skip $x:rintroPat $xs:rintroPat*) =>
`(tactic| repeat apply_ext_lemma; rintro $x:rintroPat; ext_or_skip $xs:rintroPat*)
`(tactic| (repeat apply_ext_lemma); rintro $x:rintroPat; ext_or_skip $xs:rintroPat*)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the key change: otherwise repeat repeats the whole thing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be fixed in core, because it's a very unobvious precedence when written in one line style.

@dwrensha

Copy link
Copy Markdown
Member

nice!

@gebner

gebner commented Aug 19, 2022

Copy link
Copy Markdown
Member Author

bors merge

bors Bot pushed a commit that referenced this pull request Aug 19, 2022
@bors

bors Bot commented Aug 19, 2022

Copy link
Copy Markdown

Pull request successfully merged into master.

Build succeeded:

@bors bors Bot changed the title fix: apply multiple ext-lemmas in a row [Merged by Bors] - fix: apply multiple ext-lemmas in a row Aug 19, 2022
@bors bors Bot closed this Aug 19, 2022
@bors
bors Bot deleted the extbug branch August 19, 2022 11:12
bors Bot pushed a commit that referenced this pull request Dec 12, 2022
Followup to #908.

Apparently `<;>` (in addition to plain `;`) has higher precedence than `try`.
Adding parentheses restores the expected behavior.

This isn't the first time we've been tripped up by unexpected precedence in the sequencing operators. See e.g. #370 (comment)
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.

3 participants