Mercurial > vim
comparison src/testdir/test55.in @ 6022:f9ec944e4474 v7.4.351
updated for version 7.4.351
Problem: sort() is not stable.
Solution: When the items are identical, compare the pointers.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 02 Jul 2014 19:06:18 +0200 |
parents | a162d41f10e1 |
children | 0a42938f449c |
comparison
equal
deleted
inserted
replaced
6021:9c68b3561d82 | 6022:f9ec944e4474 |
---|---|
330 :$put =string(reverse(reverse(l))) | 330 :$put =string(reverse(reverse(l))) |
331 :$put =string(sort(l)) | 331 :$put =string(sort(l)) |
332 :$put =string(reverse(sort(l))) | 332 :$put =string(reverse(sort(l))) |
333 :$put =string(sort(reverse(sort(l)))) | 333 :$put =string(sort(reverse(sort(l)))) |
334 :$put =string(uniq(sort(l))) | 334 :$put =string(uniq(sort(l))) |
335 :let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0.22, 'foo'] | 335 :let l=[7, 9, 'one', 18, 12, 22, 'two', 10.0e-16, -1, 'three', 0xff, 0.22, 'four'] |
336 :$put =string(sort(copy(l), 'n')) | 336 :$put =string(sort(copy(l), 'n')) |
337 :let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'foo', 'FOOBAR',{}, []] | 337 :let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', {}, []] |
338 :$put =string(sort(copy(l), 1)) | 338 :$put =string(sort(copy(l), 1)) |
339 :$put =string(sort(copy(l), 'i')) | 339 :$put =string(sort(copy(l), 'i')) |
340 :$put =string(sort(copy(l))) | 340 :$put =string(sort(copy(l))) |
341 :" | 341 :" |
342 :" splitting a string to a List | 342 :" splitting a string to a List |