-
-
Notifications
You must be signed in to change notification settings - Fork 116
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 Fix{N}
for fixing a single positional argument at any position
#829
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.
LGTM, but I don't have merge rights.
@martinholters would you be willing to take a look |
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.
Note that even with this PR,
Compat.Fix{1}
is not the same asBase.Fix1
on Julia versions earlier than1.12.0-DEV.966
. Therefore, if you wish to use this as a way to dispatch onFix{N}
for libraries compatible with Julia earlier than v1.12, you should declare a function both forCompat.Fix{1}
as well asBase.Fix1
.
Should this be documented somewhere more findable than the PR description?
Apart from that LGTM.
Co-authored-by: Martin Holters <martin.holters@hsu-hh.de>
Co-authored-by: Martin Holters <martin.holters@hsu-hh.de>
I’ll add it to the docs for the function |
Done. |
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. Barring objections, I'll merge this and #830 tomorrow and tag a new version.
Great, thanks! |
Adds JuliaLang/julia#54653.
Fixes #828.
Multiple dispatch: This is a bit of an edge case, and presumably many functions in Compat are like this, but since
Fix1
is broadly used:Note that even with this PR,
Compat.Fix{1}
is not the same asBase.Fix1
on Julia versions earlier than1.12.0-DEV.966
. Therefore, if you wish to use this as a way to dispatch onFix{N}
for libraries compatible with Julia earlier than v1.12, you should declare a function both forCompat.Fix{1}
as well asBase.Fix1
. You can do this with a