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

update Lean version and replace std to batteries #150

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

Seasawher
Copy link
Contributor

@Seasawher Seasawher commented Dec 22, 2024

This book is very out of date.

  • Std is gone and Batteries must be used.
  • Due to Lean updates, some of the code examples do not work as intended.

This PR is the first step in an attempt to update this book.

@@ -12,7 +12,7 @@ lean_lib «lean4-metaprogramming-book» where
require mdgen from git
"https://github.com/Seasawher/mdgen" @ "v1.3.0"

require std from git "https://github.com/leanprover/std4" @ "v4.7.0"
require "leanprover-community" / "batteries" @ git "main"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we use the corresponding tag -- i.e. https://github.com/leanprover-community/batteries/releases/tag/v4.15.0-rc1 -- so this doesn't break when Batteries updates its Lean version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Batteries updates will not break the code in this book until a lake update is manually performed.

This is not a problem, as any updates to Batteries should eventually be followed.

@@ -386,7 +386,7 @@ elab "custom_assump_2" : tactic =>
then return Option.some declExpr
else return Option.none
match option_matching_expr with
| some e => Lean.Elab.Tactic.closeMainGoal e
| some e => Lean.Elab.Tactic.closeMainGoal `custom_assump_2 e
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm only scanning the PR so apologies for not trying to figure this out myself, but can you say something about what's happening here with the extra argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Lean.Elab.Tactic.closeMainGoal argument appears to have been increased. It now accepts the tactic name for use in error messages.

@Julian
Copy link
Collaborator

Julian commented Dec 22, 2024

I think this looks mostly good to me, just left 2 minor comments. Appreciate the PR!

@Julian Julian merged commit f3bf762 into leanprover-community:master Dec 23, 2024
5 checks passed
@Julian
Copy link
Collaborator

Julian commented Dec 23, 2024

Got it, ok thanks again!

@Seasawher Seasawher deleted the update-lean branch December 23, 2024 17:08
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.

2 participants