-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
2874-clampLowHigh #4682
2874-clampLowHigh #4682
Conversation
Could we improve the method comment: Magnitude >> clampLow: minValue high: maxValue [ |
I read the translation in french about clamp (fixer, attacher) and I was thinking that clampLow:high: is not a super nice name. |
" 10 clampLow: 12 high: 20 >>> 12" |
Hi hilaire I was thinking about it and I did not like the solution. Because I understand the original point: it was that with low: and high: people would pass "correct" i.e., argument in order smaller and larger to get a positive interval. I would like to have a real discussion about it. Then I would define beBetween: that works in all cases for real. Here are the scenario.
|
min:max: comment should really say that it is min:thenMax: The solution would be
with different semantics. |
Agree, I don't like much the clampLow:hight: message. The intention was the keep come compatibility with Squeak, but we likely passed this point. |
May be to keep some compatibility issues, we could just keep min:max: as it is, renamed its parameters, then add a proper comment plus test as you suggested it. Now thinking about it, beBetween:and: when self is outside the interval, the message name is not meaningful about which result we expect. 10 beBetween: 5 and: 8 Or something like beBetweenLow:andHigh: but your idea is the parameters can be reversed without harm, and it will not work with this name. It fell like antinomism. We could just live with min:max: |
I will discuss with pablo and guille and let you know. |
After discussing with guile and pablo I think that we can
|
What is the expect result in these scenari 10 beBetween: 5 and: 8 |
Additional comments to min:max:
Like clipping 8 because 8 is the closest. Stef |
I don't understand the conflict |
I am not sure either about replacing
|
Hilaire usually for central message we deprecated them over multiple version. |
@Ducasse ok understood. What do you think about the other points I mentioned? |
Sorry which other point. |
in my previous comment |
I do not understand how to read the conflicts else the code is good for me. |
I fixed the conflicts and waiting for the build to rerun before integrating the changes. |
Fixes #2874