-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512


On June 10, 2014 10:13:12 PM GMT+03:00, Paul Isambert <zappathus...@free.fr> 
wrote:
>
>
>Le mardi 10 juin 2014 à 08:01, Benjamin Klein a écrit:
>> I did notice that the sort() help says that it sorts based on the
>> String representation of the items,
>
>Me neither, which is why I called it a bug.
>
>>                                     so I guess this is at least
>> *mentioned*, but I agree in considering it a bug. At the very least
>> I'd expect an alternate function to be built in.
>
>It isn’t a bug if it is designed to work as mentioned; let’s call it a
>bad decision :) (Does anybody knows the reason why, if any?)

How would you sort a heterogeneous list otherwise? There is a string 
representation for any kind of value, but it is not true for numbers or other 
types. Cannot say whether it was a reason, but it has some logic. Not that I 
would code sorting this way though: I would rather sort by types first and then 
have type-specific comparison.

There is also one consideration: almost everywhere you can use numbers where 
you use strings and vice versa and numeric comparison in one case and string 
comparison in the other (assuming mixed string/number list)* breaks this.

* note on assumption: comparison operators already behave differently if they 
are passed two strings, so it does not apply. To be consistent with comparison 
operators one really needed to sort in numeric order if there is at least one 
number in a list, in string order if there are only strings and raise an error 
if there are funcrefs or container types though, not use string order. So more 
likely first reason applies.
-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQI1BAEBCgAfBQJTl06BGBxaeVggPHp5eC52aW1AZ21haWwuY29tPgAKCRCf3UKj
HhHSvkMfD/47VBP57cAoATnX1O5xjIdeSM626tj7rG2YWzncqeoMAqzUKU+QrRUc
CuDbp33ZJo8RARvuwdijyTHe/Cc5vE3zGlSvGGg2RpfdyKHeHNhgxSFIavZLlvY6
IWuvP9Yhop7t7ff9GSWKD2GYL2CNNC08fHynTQSQ29imKCAgvLtjGgGPkJtXp8PW
/MlxepQgqbHZ0qgSQQjjT71rb6oULHt95T71KwL6gHOLIRWQaWhzuiFkLGS5BN9E
HePRrij1TQ1YtqnL1HXnmDnx0M7HXqy6jr38mFZiMq2N1l5js1r1fcNIpDfUyA3y
h1bWWEf7nnGq+QbDa9NL6duSSzI6zBFzPU/y+xaP6ZzQWFu+I6tVkxt21b17ieNH
bqjwJhKRfo/qPqDqR9A23KJggBcxj46UE6nMid+ufSn/DwzWRkwovWT7DALreUBB
4Y0MvihR2F5G2R4gZnxt4d5AKIGY6NGw5kQSZKzBpMUPjuMVev309+VPUXMMIi/e
1JX9UsDmUwE4zFC7snl7awvAv31vgEbkrp2KEGYqz1JerD/VpvWCQLrSbVOTG+T5
Y9cIa8Sjcf9wou6z0RP6y6tpDiBriBE8op2eLT36Pacov+a4Gu2Mf3U+D8hZFpdK
7AR7Dwfct+ziDX10SVKaNol4LqGcUQTvlAg6KlgTPADOIgGjzI1FNg==
=E/L+
-----END PGP SIGNATURE-----

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to