-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 Base.FixKwargs (a la Base.Fix1) for more introspectable broadcasts #36093
base: master
Are you sure you want to change the base?
Conversation
Thanks, I reflected the comments. |
It'd be nice if #36094 can be merged first so that |
I don't think order matters much — it's just one line of code in whichever PR goes second and it totally makes sense to include that line in either PR. I'm 👍 with the broadcasting usage, changing the title to potentially attract a reviewer that cares more about our pseudo-currying functionality. |
It's just that @StefanKarpinski is a bit hesitant to add |
This PR adds
Base.Broadcast.FixKwargs
which can be used to match and destructure dot-calls with keyword arguments. I think this is useful to have this as a public API.Examples
Toy example
Example: keyword argument broadcasting
Keyword argument broadcasting #34737 can be implemented by users based on public API:
Type stability
While I'm at it, this PR also solves the problem with closures capturing types #23618. Before this PR, this test failed
julia/test/broadcast.jl
Lines 270 to 276 in 2290c4b
and it now passes in this PR.