forum-msg-id-125259-edit

Original date:2014-11-06 19:02:59 Edited by: Spock Subject: Re: Euphoria's identity/philosophy Where is the focus?

[quote jimcbrown]

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? ..

[/quote]

 
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

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu