-
Notifications
You must be signed in to change notification settings - Fork 447
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
def _root_...
creates literal _root_
namespace
#490
Comments
We should not create a |
Yeah, not accepting the second check is good enough for now |
@gebner Is this feature important for the mathlib port? |
Yes, this feature was implemented in lean 3 and gets some use. It's not incredibly common but there isn't any obvious way for synport to drop in an alternative without significantly changing the surrounding syntax (closing all the namespaces, adding the definition, reopening the namespace and adding all the variables and local things back...) |
To give concrete numbers, it occurs 651 times in mathlib. We might also need it to override instance names in the port: leanprover-community/mathport#106 |
@digama0 @gebner Thanks for the feedback. Could you please confirm whether the following is the behavior you are expecting?
def Bla.z := 1
namespace Foo
open Bla
def x := 10
def _root_.y := x + z -- `x` here is referring to `Foo.x` and `z` to `Bla.z`
Any other gotchas? |
These are to some extent unexplored questions since the way lean 4 handles namespaced definitions, as though there was a Here's a way that I think can lead to coherent answers to these questions: Imagine that we can write With that model, the name resolution would act as though the The behavior of |
Pushed the wrong file in previous commit. see #490
With this, the files `init.core` and `init.logic` are synchronized, although we aren't currently tracking files from `init` in [port-status](https://github.com/leanprover-community/mathlib/wiki/mathlib4-port-status). Co-authored-by: Scott Morrison <[email protected]>
* [x] depends on leanprover#490
Expected behavior: for the first
#check
to workActual behavior: the second
#check
unexpectedly worksThe text was updated successfully, but these errors were encountered: