-
Notifications
You must be signed in to change notification settings - Fork 715
feat: allow structures to have non-bracketed binders #8671
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
Conversation
|
changelog-language |
|
Mathlib CI status (docs):
|
|
awaiting-review |
kmill
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've been wanting to see this done.
The code looks good, and I just want to see some changes to the test file.
| stack.matches [`null, none, `null, none, ``Lean.Parser.Command.inductive] && | ||
| (stack[3]? |>.any fun (stx, pos) => | ||
| pos == 0 && | ||
| [``Lean.Parser.Command.optDeclSig, ``Lean.Parser.Command.declSig].any (stx.isOfKind ·))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any idea why it was looking for declSig? I looked through git history and, even when this was first introduced (maybe in this commit) the parser used optDeclSig.
As far as I can tell, inductive always used optDeclSig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know for sure. My guess is that isInInductive in the original commit was copied from isInDeclarationSignature without simplification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look. The PR looks good, and I'll add it to the merge queue, thanks!
This PR allow structures to have non-bracketed binders, making it consistent with `inductive`. The change allows the following to be written instead of having to write `S (n)`: ```lean structure S n where field : Fin n ```
This PR allow structures to have non-bracketed binders, making it consistent with `inductive`. The change allows the following to be written instead of having to write `S (n)`: ```lean structure S n where field : Fin n ```
This PR allow structures to have non-bracketed binders, making it consistent with
inductive.The change allows the following to be written instead of having to write
S (n):