Administrator
|
On Thu, May 21, 2015 at 2:19 PM, Sean P. DeNigris <[hidden email]> wrote: Squeak 4.6 "Spur" Release Notes Tag sort functions looks great to have around. About the spaceship operator (<=>), is this something we'd like to have around? (I like it). http://en.wikipedia.org/wiki/Three-way_comparison Phil
-- |
How would you make this “object oriented”? Have three singleton objects “Less”, “Greater”, “Equal” (similar to “True”, "False”), and on those object methods “ifLess:”, “ifEqual:”, “ifGreater:”?
|
56 <=> 43 --> -1 "abcd" <=> "defgh" --> +1On Thu, May 21, 2015 at 4:22 PM, Max Leske <[hidden email]> wrote:
|
In reply to this post by Max Leske
The elegant API for multi-level sorting is more important (and orthogonal to this weird operator, there is already String>>#compare:)
> On 21 May 2015, at 16:22, Max Leske <[hidden email]> wrote: > >> >> On 21 May 2015, at 15:01, [hidden email] wrote: >> >> >> >> On Thu, May 21, 2015 at 2:19 PM, Sean P. DeNigris <[hidden email]> wrote: >> Squeak 4.6 "Spur" Release Notes >> http://wiki.squeak.org/squeak/6192 >> >> Tag sort functions looks great to have around. >> >> About the spaceship operator (<=>), is this something we'd like to have around? (I like it). http://en.wikipedia.org/wiki/Three-way_comparison > > How would you make this “object oriented”? Have three singleton objects “Less”, “Greater”, “Equal” (similar to “True”, "False”), and on those object methods “ifLess:”, “ifEqual:”, “ifGreater:”? > >> >> Phil >> >> >> >> ----- >> Cheers, >> Sean >> -- >> View this message in context: http://forum.world.st/Opportunity-to-steal-good-ideas-from-dad-tp4827836.html >> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com. >> >> >> >> >> -- |
In reply to this post by philippeback
I said “object oriented”… :p
|
In reply to this post by philippeback
2015-05-21 10:01 GMT-03:00 [hidden email] <[hidden email]>:
> > > On Thu, May 21, 2015 at 2:19 PM, Sean P. DeNigris <[hidden email]> > wrote: >> >> Squeak 4.6 "Spur" Release Notes >> http://wiki.squeak.org/squeak/6192 > > > Tag sort functions looks great to have around. > > About the spaceship operator (<=>), is this something we'd like to have > around? (I like it). http://en.wikipedia.org/wiki/Three-way_comparison http://www.smalltalkhub.com/#!/~emaringolo/SortFunctions I use them extensively. Esteban A. Maringolo |
In reply to this post by philippeback
> On 21 May 2015, at 15:01, [hidden email] wrote: > > Tag sort functions looks great to have around. > > About the spaceship operator (<=>), is this something we'd like to have around? (I like it). http://en.wikipedia.org/wiki/Three-way_comparison http://objology.blogspot.be/2010/11/tag-sortfunctions.html http://objology.blogspot.be/2010/11/tag-sortfunctions-redux.html |
In reply to this post by Esteban A. Maringolo
> On 21 May 2015, at 16:50, Esteban A. Maringolo <[hidden email]> wrote: > > 2015-05-21 10:01 GMT-03:00 [hidden email] <[hidden email]>: >> >> >> On Thu, May 21, 2015 at 2:19 PM, Sean P. DeNigris <[hidden email]> >> wrote: >>> >>> Squeak 4.6 "Spur" Release Notes >>> http://wiki.squeak.org/squeak/6192 >> >> >> Tag sort functions looks great to have around. >> >> About the spaceship operator (<=>), is this something we'd like to have >> around? (I like it). http://en.wikipedia.org/wiki/Three-way_comparison > > http://www.smalltalkhub.com/#!/~emaringolo/SortFunctions > > I use them extensively. > > Esteban A. Maringolo Cool !!! |
In reply to this post by Max Leske
On Thu, May 21, 2015 at 4:39 PM, Max Leske <[hidden email]> wrote:
Bah, let's got with lots of ifTrue:ifFalse: ... Hopefully, a kind soul will iterate on this and make it OO :-)
Object>><=> anObject
|
In reply to this post by Max Leske
On 21 May 2015 at 16:22, Max Leske <[hidden email]> wrote:
In http://mc.lukas-renggli.ch/container/ Lukas defined a hierarchy of comparator classes which answer messages like equals: X to: Y less: X than: Y maximum: anIterable etc. |
In reply to this post by Esteban A. Maringolo
> On 21 May 2015, at 16:50, Esteban A. Maringolo <[hidden email]> wrote: > > 2015-05-21 10:01 GMT-03:00 [hidden email] <[hidden email]>: >> >> >> On Thu, May 21, 2015 at 2:19 PM, Sean P. DeNigris <[hidden email]> >> wrote: >>> >>> Squeak 4.6 "Spur" Release Notes >>> http://wiki.squeak.org/squeak/6192 >> >> >> Tag sort functions looks great to have around. >> >> About the spaceship operator (<=>), is this something we'd like to have >> around? (I like it). http://en.wikipedia.org/wiki/Three-way_comparison > > http://www.smalltalkhub.com/#!/~emaringolo/SortFunctions > > I use them extensively. > > Esteban A. Maringolo I had a look. Apart from the fact that for some reason, the extensions on MAElement are in the Core package, hence loading just Core gave errors, things looked OK. This is generally useful, small and a very good example of super cool OO design. I would vote to integrate this (<=> and all). Sven |
Thinking of the <=> operator, this can be useful for things like this: dataset := #(1 3 4 5 7 8 5 2 3 0). mean := dataset average. dataset collect: [ :each | mean <=> each ] --> #(1 1 -1 -1 -1 -1 -1 1 1 1) This we can also do with coll := #(1 3 4 5 7 8 5 2 3 0). mean := coll average. coll collect: [ :each | (mean - each) sign ] but still. Other use cases for <=> ? On Fri, May 22, 2015 at 11:43 AM, Sven Van Caekenberghe <[hidden email]> wrote:
|
In reply to this post by Sean P. DeNigris
If people wants to harvest some changes from Squeak, please do it.
Collections Speed up testing different sized strings. Interval >> #sum is now O(1) instead of O(n). Introduction of Set>>#addNewElement: optimizes graph-traversal. Slightly faster SequenceableCollection >> #copyUpT (for ByteString receivers). Stricter and faster implementation of String >> #format:. Optimized Interval >> #sum, OrderedCollection >> #at: and OrderedCollection >> #at:put:. Simpler and faster Character >> #tokenish. Speed-up #endsWith: for strings. Morphic Sped up #valueOfProperty:ifAbsent: and friends. Symbol table improvements such as thread-safety and consistent enumeration. Threadsafe random. > Squeak 4.6 "Spur" Release Notes > http://wiki.squeak.org/squeak/6192 > > > > ----- > Cheers, > Sean > -- > View this message in context: http://forum.world.st/Opportunity-to-steal-good-ideas-from-dad-tp4827836.html > Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com. > > |
In reply to this post by Sven Van Caekenberghe-2
2015-05-22 6:43 GMT-03:00 Sven Van Caekenberghe <[hidden email]>:
>> On 21 May 2015, at 16:50, Esteban A. Maringolo <[hidden email]> wrote: >>> About the spaceship operator (<=>), is this something we'd like to have >>> around? (I like it). http://en.wikipedia.org/wiki/Three-way_comparison >> http://www.smalltalkhub.com/#!/~emaringolo/SortFunctions >> I use them extensively. > I had a look. > > Apart from the fact that for some reason, the extensions on MAElement are in the Core package, hence loading just Core gave errors, things looked OK. > > This is generally useful, small and a very good example of super cool OO design. > > I would vote to integrate this (<=> and all). For some reason the extensions of MAElementDescription where both in SortFunctions-Core and SortFunctions-Magritte. Also the dependency to Magritte in the Metacello config was wrong. Now it works as expected (please test :)). And a new stable version was uploaded to the smalltalkhub repo. Please notice my port includes the option to collate the undefined elements at the beginning or the end, in a similar fashion to ORDER BY [column] NULLS [LAST|FIRST] in SQL (Oracle/PostgreSQL at least). I would also vote to have this in the base image. It is my base image at least :) Regards! -- Esteban A. Maringolo |
In reply to this post by philippeback
What is <=> because I found it quite not intention revealing.
Le 22/5/15 11:19, [hidden email] a
écrit :
|
In reply to this post by Sven Van Caekenberghe-2
http://www.smalltalkhub.com/#!/~emaringolo/SortFunctions I use them extensively. Esteban A. Maringolo > I had a look. > > Apart from the fact that for some reason, the extensions on MAElement are in the Core package, hence loading just Core gave errors, things looked OK. > > This is generally useful, small and a very good example of super cool OO design. > > I would vote to integrate this (<=> and all). Why? Can we rewrite a large part of the system with it? If not why people cannot just load a package? We should stop to think monolithic. Stef |
Free forum by Nabble | Edit this page |