-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
add: Meta.isreserved
public api
#57846
add: Meta.isreserved
public api
#57846
Conversation
Signed-off-by: prashantrahul141 <prashantrahul141@protonmail.com>
Signed-off-by: prashantrahul141 <prashantrahul141@protonmail.com>
Signed-off-by: prashantrahul141 <prashantrahul141@protonmail.com>
Signed-off-by: prashantrahul141 <prashantrahul141@protonmail.com>
Sorry, but what is this for? Shouldn't this live in the parser somewhere instead? |
#26090 has some info when it would be useful. |
@Seelengrab I noticed that the definitions of other similar exported functions, like Also, the reason I moved |
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 like that this is defined in Base and imported and re-exported from Meta as well as public in Base because I would prefer there only be a single way to publically access functions when possible. That said, I agree with your choice to follow the same pattern as isoperator
, isidentifier
, etc.
Tagging triage because this adds a new public feature and once we release it we'll be committed to living with the consequences forever so it's worth double checking that we want this.
That makes sense as a use, but I'd still place this in the parser rather than
Tbh, I'm not entirely sure why there's a bunch of parser-related functionality in Meta in the first place - I'd assume that this module is for metaprogramming related stuff, not parsing/lexing. Probably some legacy reasons? |
I get that you don't like the location of the existing functionality (and neither do I) but hopefully we can agree that it would be silly to have If you care enough to want to make a change, @Seelengrab, you can open a conversation about @prashantrahul141, good job following the existing pattern and maintaining consistency among related concepts. |
I do think we agree, that's exactly why I'm proposing to put this into the actual parser module :) I believe that's JuliaSyntax at the moment? It might already be there, I haven't checked. I'm not sure why you seem to think that we disagree 🤔 I'm not proposing to move the existing code somewhere else. The code in this PR is (from what I can tell) good and the reasoning why it came up also makes sense. |
I think users should be able to check things like valid operators and reserved keywords with just the standard library without relying on external modules or libraries. This is especially true for Julia, given its powerful metaprogramming capabilities. That said, I agree with you, @Seelengrab, that metaprogramming-related functionality doesn’t belong in a file named
Also, I would be interested in working on that! |
Signed-off-by: prashantrahul141 <prashantrahul141@protonmail.com>
Triage meets every other Thursday at 13:15 ET. The next meeting is 4 days and 4.5 hours from now. @prashantrahul141, you're welcome to attend if you would like! (but there's no expectation if you don't want to or can't make the time). By virtue of having the There is some asynchronous triage discussion on the #triage slack channel (get an invite here: https://julialang.org/slack/) and the meetings themselves happen here: https://mit.zoom.us/j/92625773516?pwd=TG0zUVpvSnlCdVRJd3NHeW9XK1ErQT09 |
Where? Meta is even the entrypoint to the parser. It is completely consistent to have this in Meta. |
Probably right below |
JuliaSyntax is an implementation detail of Julia. It is not an stdlib so adding it there does nothing unless you want people to have to add a dependency on JuliaSyntax for this feature. |
I'm not sure Meta is an stdlib either (it's not listed in the dropdown in the docs, and only mentioned as a submodule of Base). It's just easier to maintain only one list of keywords instead of having to keep two definitions that don't know about each other in sync 🤷 I wasn't aware that JuliaSyntax is only considered an implementation detail. |
Who said it was?? The point is that JuliaSyntax is not an stdlib nor a Base module nor anything... |
@prashantrahul141, @mbauman made some interesting and convincing points about how |
This adds
Meta.isreserved
to check whether a symbol or string is a reserved julia keywordcloses #26090