Re: [Pharo-users] min:max:

2018-04-22 Thread Richard O'Keefe
Smalltalk/X has both #min:max: and #clampBetween:and: in its Magnitude.st. Dolphin 7 has neither. The definition of #clampBetween:and: in ST/X is clampBetween: min and: max max < self ifTrue: [^max]. self < min ifTrue: [^min]. ^self I've deleted the comment because it doesn't help w

Re: [Pharo-users] min:max:

2018-04-22 Thread Richard O'Keefe
On 22 April 2018 at 05:59, PBKResearch wrote: > I can find no reference to #min:max: in Dolphin X6.1. > > Peter Kenny > > -Original Message- > From: Pharo-users On Behalf Of > Hilaire > Sent: 21 April 2018 17:36 > To: pharo-users@lists.pharo.org > Subj

Re: [Pharo-users] min:max:

2018-04-21 Thread PBKResearch
I can find no reference to #min:max: in Dolphin X6.1. Peter Kenny -Original Message- From: Pharo-users On Behalf Of Hilaire Sent: 21 April 2018 17:36 To: pharo-users@lists.pharo.org Subject: Re: [Pharo-users] min:max: The #min:max: message is present in the Squeak/Pharo/Cuis familly

Re: [Pharo-users] min:max:

2018-04-21 Thread Hilaire
The #min:max: message is present in the Squeak/Pharo/Cuis familly but not in GNU Smalltalk for example. No idea about the other ones. Le 21/04/2018 à 00:12, Chris Cunningham a écrit : A name like this would be clearer (although much more annoying): returnAtLeast: minValue butNoMoreThan: maxVa

Re: [Pharo-users] min:max:

2018-04-21 Thread Stephane Ducasse
Yes :) On Sat, Apr 21, 2018 at 4:21 PM, Sven Van Caekenberghe wrote: > > >> On 21 Apr 2018, at 15:35, Stephane Ducasse wrote: >> >> Oh yes >> >> On Sat, Apr 21, 2018 at 12:12 AM, Chris Cunningham >> wrote: >>> A name like this would be clearer (although much more annoying): >>> >>> returnA

Re: [Pharo-users] min:max:

2018-04-21 Thread Sven Van Caekenberghe
> On 21 Apr 2018, at 15:35, Stephane Ducasse wrote: > > Oh yes > > On Sat, Apr 21, 2018 at 12:12 AM, Chris Cunningham > wrote: >> A name like this would be clearer (although much more annoying): >> >> returnAtLeast: minValue butNoMoreThan: maxValue >>10 returnAtLeast: 12 butNoMoreTha

Re: [Pharo-users] min:max:

2018-04-21 Thread Stephane Ducasse
Oh yes On Sat, Apr 21, 2018 at 12:12 AM, Chris Cunningham wrote: > A name like this would be clearer (although much more annoying): > > returnAtLeast: minValue butNoMoreThan: maxValue > 10 returnAtLeast: 12 butNoMoreThan: 48 > > Thanks, > cbc > > On Fri, Apr 20, 2018 at 12:51 PM, Hilaire

Re: [Pharo-users] min:max:

2018-04-21 Thread Stephane Ducasse
On Fri, Apr 20, 2018 at 9:51 PM, Hilaire wrote: > Hi, > > Out of curiosity. > > I always found the #min:max: confusing and lost in its expressiveness. > > One should write: > > 10 min: 48 max: 12 I do not understand the result :) To me this method is illnamed. > > to expect 12. > > but logi

Re: [Pharo-users] min:max:

2018-04-20 Thread Ben Coman
On 21 April 2018 at 03:51, Hilaire wrote: > Hi, > > Out of curiosity. > > I always found the #min:max: confusing and lost in its expressiveness. > > One should write: > > 10 min: 48 max: 12 > > to expect 12. > > but logically one (at least me) may want to express it as: > > 10 min: 12 max

Re: [Pharo-users] min:max:

2018-04-20 Thread herby
On April 21, 2018 12:12:10 AM GMT+02:00, Chris Cunningham wrote: >A name like this would be clearer (although much more annoying): > >returnAtLeast: minValue butNoMoreThan: maxValue >10 returnAtLeast: 12 butNoMoreThan: 48 #beBetween:and: or #boundedBetween:and: >Thanks, >cbc > >On Fri, Ap

Re: [Pharo-users] min:max:

2018-04-20 Thread Chris Cunningham
A name like this would be clearer (although much more annoying): returnAtLeast: minValue butNoMoreThan: maxValue 10 returnAtLeast: 12 butNoMoreThan: 48 Thanks, cbc On Fri, Apr 20, 2018 at 12:51 PM, Hilaire wrote: > Hi, > > Out of curiosity. > > I always found the #min:max: confusing and lo

[Pharo-users] min:max:

2018-04-20 Thread Hilaire
Hi, Out of curiosity. I always found the #min:max: confusing and lost in its expressiveness. One should write:     10 min: 48 max: 12 to expect 12. but logically one (at least me) may want to express it as:     10 min: 12 max: 48 Then when reading its source code, it is even more confusing