leanprover-community / lean4-metaprogramming-book

https://leanprover-community.github.io/lean4-metaprogramming-book/
Apache License 2.0
204 stars 47 forks source link

use `#check_failure` command to erase errors #131

Closed Seasawher closed 3 months ago

Seasawher commented 5 months ago

see: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/the.20metaprogramming.20book/near/386542851

There seems to be an intentional error in the code, which will be an obstacle when you try to update Lean version later.

As a way to indicate errors while avoiding them, I suggest the following.

This PR pointed out where errors can be avoided simply by using #check_failure.I would like to hear your views on where check_failure cannot be used.

Thank you.

Julian commented 5 months ago

As I mentioned in Zulip I'm not 100% comfortable here given I actually have not read the book yet :D -- if no one else chimes in I'm comfortable enough though that you know the right thing :) given your contributions -- but I do think if we use these that the text of the book should at least mention what #check_failure does in an aside, in case the reader isn't familiar with what it's for. Does that make sense?

Seasawher commented 5 months ago

Thanks for your comment.

Seasawher commented 3 months ago

@Julian Review please.

Julian commented 3 months ago

Looks good I think. Thanks again!