leanprover-community / leanprover-community/lean
Add function for retrieving current namespace
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 434
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Description
This is very easy. There are two options, since if we are currently in a namespace the builtin tactic.open_namespaces returns the current namespace as the first entry:
-
Modify the code so that
open_namespacesprependsname.anonymousto the list it currently returns whenopen_namespacesis called outside any namespace, or -
Just add a new library function to do this.
In keeping with the namespace/monad for tactic.open_namespaces, this function should have type tactic name. Note that tactic (option name) or anything of the link is unnecessary because the semantically correct value when no namespace is open is just name.anonymous.
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Checked that your issue isn't already filed.
- Specifically, check out the wishlist, open RFCs,
or feature requests.
- Specifically, check out the wishlist, open RFCs,
- Reduced the issue to a self-contained, reproducible test case.
- Checked that your issue isn't already filed.
Description
[Description of the issue]
Steps to Reproduce
- [First Step]
- [Second Step]
- [and so on...]
Expected behavior: [What you expect to happen]
Actual behavior: [What actually happens]
Reproduces how often: [What percentage of the time does it reproduce?]
Versions
You can get this information from copy and pasting the output of lean --version,
please include the OS and what version of the OS you're running.
Additional Information
Any additional information, configuration or data that might be necessary to reproduce the issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the implementation and callers of the builtin tactic.open_namespaces, then check how namespace names and name.anonymous are represented. Add a library function with type tactic name that returns the current namespace, including name.anonymous outside a namespace, and verify it with a focused tactic test.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100