<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">On Sat, 21 Apr 2018, Ben Coman wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 21 April 2018 at 03:51, Hilaire <<a href="mailto:hilaire@drgeo.eu" target="_blank">hilaire@drgeo.eu</a>> wrote:<br>
      Hi,<br>
<br>
      Out of curiosity.<br>
<br>
      I always found the #min:max: confusing and lost in its expressiveness.<br>
<br>
      One should write:<br>
<br>
          10 min: 48 max: 12<br>
<br>
      to expect 12.<br>
<br>
      but logically one (at least me) may want to express it as:<br>
<br>
          10 min: 12 max: 48<br>
<br>
      Then when reading its source code, it is even more confusing:<br>
<br>
      min: aMin max: aMax<br>
          ^ (self min: aMin) max: aMax<br>
<br>
      Are not the argument names inversed in their meaning, if any?<br>
<br>
<br>
I would agree.  I see most use by Color like...<br>
 <br>
    Color>>adjustBrightness: brightness<br>
        "Adjust the relative brightness of this color. (lowest value is 0.005 so that hue information is not lost)"<br>
<br>
        ^ self class<br>
                h: self hue<br>
                s: self saturation<br>
                v: (self brightness + brightness min: 1.0 max: 0.005)<br>
                alpha: self alpha<br>
<br>
Trying to read that twists my brain.  <br>
<br>
<br>
I can understand the intent from the implementation <br>
min: aMin max: aMax <br>
^ (self min: aMin) max: aMax<br>
<br>
but that message might more properly be  #min:thenMax:<br>
However something like    <br>
    (self brightness + brightness boundedBy: 0.005 and: 1.0)<br>
    (self brightness + brightness boundedMin: 0.005 m<wbr>ax: 1.0)<br>
seems more intention revealing.<br>
<br>
<br>
Altering  #min:max  semantics would make awful portability,<br>
but perhaps it should forward to a new method to make it clear the other is preferred.<br>
<br>
Would the Squeak community be amenable to a similar change?<br>
I'd be happy to contribute the changes to the Squeak Inbox.<br></blockquote></div></div></blockquote></div><br></div><div class="gmail_extra">

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">On 21 April 2018 at 17:56, Levente Uzonyi<span> </span></span><span dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><<a href="mailto:leves@caesar.elte.hu" target="_blank" style="color:rgb(17,85,204)">leves@caesar.elte.hu</a>></span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>wrote:</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><blockquote class="gmail_quote" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Squeak has #clampLow:high: for this reason.<span class="gmail-HOEnZb"><font color="#888888"><br></font></span><div class="gmail-HOEnZb"><div class="gmail-h5" style="display:block;color:rgb(80,0,80)"><br></div></div></blockquote>

<br></div><div class="gmail_extra">

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Thanks Levente.  </span>Thats a good one.</div><div class="gmail_extra">With similar usage clamping signals in electronics, this is worthwhile to adopt.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="https://pharo.fogbugz.com/f/cases/21758/Replace-min-max-with-clampLow-High">https://pharo.fogbugz.com/f/cases/21758/Replace-min-max-with-clampLow-High</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">cheers -ben</div><div class="gmail_extra"><br></div></div>