-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Tracking issue for {f32, f64}::copysign #58046
Comments
@rfcbot fcp merge |
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
I've mentioned this on the PR before: |
I did see that comment in the PR, but found the next comments convincing:
|
Sorry for not creating the tracking issue myself, I had it in my list of things to do but didn't get around to it. I don't have much to add; if this were a "de novo" function, then the name change would make sense, but I think consistency with existing usage carries weight. |
This seems fine since it can be replaced with logic that doesn't use an intrinsic if necessary. However, i n future, please include the lang team when exposing intrinsics. |
I think changing the name to be clearer has precedent; we have I think How about |
I have two issues with |
Ah, I typo'd, sorry! I did mean to reverse the arguments and make B mutable.
While it may seem arbitrary I think it's clearer, if less composable. I'm
not sure if copying the sign of another value is a prime candidate for
composition though.
I don't think there's any clear way to phrase this without reversing
argument order, because "A is acted on by B" sounds clumsy compared to "B
acts on A".
…On Sun, 3 Feb 2019, 21:28 Raph Levien ***@***.*** wrote:
I have two issues with copy_sign_to. First, it seems like the order of
arguments is reversed, which I think can be confusing. Second, the "to"
makes it sound more like it's mutating.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#58046 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABbx29dTo_qNihi-p3I7VGr9Y7IEdUpfks5vJ1SMgaJpZM4ad-b9>
.
|
|
This seems to have gotten stuck for a while, and it looks like the only blocker is the function name. Many libraries and developers already describe this function as I would also suggest that we generally seem to do operations this way around, taking the argument and applying it with the operation to self, rather than taking self and applying it with the operation to the argument. I think this is a case where the change will cause more confusion than the established name will. |
I looks like the consensus is in favor of copysign(), and I think think the combination of this being both an established concept and a somewhat rarely used function make that a reasonable choice. Please feel free to mark the concern as resolved (I don't think I can do that myself...) |
I think @alexcrichton needs to mark it resolved? @rfcbot resolve naming |
@rfcbot resolve naming |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
I guess I'm a little late with this comment but I think the name should be |
…Sapin Stablize {f32,f64}::copysign(). Stablization PR for rust-lang#55169/rust-lang#58046. Please check if i'm doing it correctly. Is 1.35.0 good to go?
I personally don’t have an opinion on this. (The name without a space has precedent and might help in search engine results.) But since the stabilization PR has merged in the 1.35 cycle, if we rename we should do so this or next week. |
My preference is for |
I'm assuming the method name suggestion logic would find |
Maybe too late for bikeshedding, but could the parameter |
@cwhakes The parameter's name is not part of the stable interface so you can just file a PR for that and I'll review it. |
|
Yep. |
These methods landed in October 2018 in #55169 without a tracking issue.
CC @raphlinus
The text was updated successfully, but these errors were encountered: