-
Notifications
You must be signed in to change notification settings - Fork 2
Add simple @public macro, set compat to Julia 1.10
#32
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
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #32 +/- ##
=======================================
Coverage 91.64% 91.64%
=======================================
Files 28 28
Lines 1185 1185
=======================================
Hits 1086 1086
Misses 99 99 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The recommended way is to do Also, ideally, the other packages don't need to import new things from Core for this. |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
|
I'm aware of that but it does it is not very easy to use, read, or maintain. The way @LilithHafner phrased this in JuliaLang/julia#55097 is this was just an alternative rather than a recommendation. While that and the more complicated macros in Public.jl and Compat.jl do handle a more complicated case of nested macro calls, you do not do that here at all. The I will also note that I do not have a clear vision of how you would want this to be implemented otherwise. My best guess is a
I'm unclear whether you meant I have relaxed the the version bound to match so far. Feel free to branch off or start again if you have e a clear vision of how you think it should look. Otherwise, I will try to address it once I get more feedback from you. |
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 recommend depending on Compat.jl rather than re-inventing the wheel here but there's nothing fundamentally wrong with this approach.
| macro public(s::Symbol) | ||
| return esc(Expr(:public, s)) | ||
| end | ||
| macro public(e::Expr) | ||
| return esc(Expr(:public, e.args...)) | ||
| end | ||
| else | ||
| macro public(e) end |
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.
| macro public(s::Symbol) | |
| return esc(Expr(:public, s)) | |
| end | |
| macro public(e::Expr) | |
| return esc(Expr(:public, e.args...)) | |
| end | |
| else | |
| macro public(e) end | |
| macro var"public"(s::Symbol) | |
| return esc(Expr(:public, s)) | |
| end | |
| macro var"public"(e::Expr) | |
| return esc(Expr(:public, e.args...)) | |
| end | |
| else | |
| macro var"public"(e) end |
Public is a keyword so it is best to protect it with var. (the same way you would have to write an @export macro).
|
Added another iteration on this in #33 |
Here we employ a simplified
@publicmacro that works for all uses in this repository.The effectiveness of the public macro is confirmed in testing.