Re: Euphoria's identity/philosophy -- Where is the focus?
- Posted by Spock Nov 06, 2014
- 2937 views
jimcbrown said...
Spock said...
sort_columns() - NOT stable, in fact, worthless for business apps or anything where the correctness of the end data is paramount.
Can you give examples where the end data is incorrect? ..
sequence testdata = { {1,1}, {2,1}, {2,2}, {1,2}, {3,1}, {2,3}, {2,4}, {1,3}, {2,5}, {3,2} } ? sort_columns(testdata, {1}) -- Result: { {1,1}, {1,2}, {1,3}, {2,2}, -- 1 {2,4}, -- 2 {2,1}, -- 3 {2,5}, -- 4 {2,3}, -- 5 {3,1}, {3,2} }
The elements for the middle block are completely jumbled up. The commented numbers show what should have been in the 2nd column, if the sort were stable.
I wonder why nobody picked this up sooner? Of course, it did give me a chance to have a good rant..
Spock