-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix Tricks.jl to work for closures #30
Conversation
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.
Looks good to me! Just a couple legibility suggestions based on my personal taste. Feel free to ignore them though if you disagree.
Thanks @MasonProtter - have another look if you can? :) i don't have the power to re-request a review, unfortunately. |
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.
The implementation is good so far as I can tell.
The only thing I can think of is maybe also add a test with a closure that captures a Box
'd value or a Ref
? I know it shouldn't matter, but sometimes weird things can be different when a value isn't inline.
We should also think about just dropping support for versions less than v"1.3"
. IMO it is dangerous and incorrect that these functions used to not support closures.
well, thankfully they just threw an error, so i don't think it's dangerous? but yeah, i was surprised to see support for julia < 1.3 as well. |
can you suggest a test? It'd be easier than me trying to guess at what you have in mind i think! ❤️ |
Urg, looks like this repo doesn't have GHA setup. |
I have given you merge rights. |
Awesome - thanks!! :) |
Clean up the style of the list comprehensions. Co-authored-by: Mason Protter <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #30 +/- ##
===========================================
- Coverage 100.00% 98.43% -1.57%
===========================================
Files 1 1
Lines 45 64 +19
===========================================
+ Hits 45 63 +18
- Misses 0 1 +1
Continue to review full report at Codecov.
|
Cool, i'm glad you added CI, since this wasn't working on julia 1.3 (or any versions < v1.6). I've fixed it now, but it's even uglier 🙈 If you don't mind, I'll leave this PR open for another round of reviews from you both to see if maybe you can see some cleaner APIs to call that I missed? 🙏 thanks! |
Pull Request Test Coverage Report for Build 1174594970
💛 - Coveralls |
Pull Request Test Coverage Report for Build 1174594970
💛 - Coveralls |
Pull Request Test Coverage Report for Build 1275872199
💛 - Coveralls |
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.
let's do it, can always clean up later
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.
LGTM
Alright - sorry for my delay. :) Merging now! |
Before this PR, the static functions wouldn't work for closures, because their type doesn't have a singleton
type.instance
defined (since there can be more than one instance!):After this PR, it works correctly. 😊
I had to copy some functionality over from Base, because they don't provide easy utility functions that work on function-types, only on function instances, so we had to build that ourselves (since we have only function-types, thanks to the generated function).