|
2014-04-11
| ||
| 14:51 | • Closed ticket [47e365d639]: LSORT -DICTIONARY does not honour number sign chiral... artifact: ca5d25a627 user: dkf | |
| 01:25 | • New ticket [47e365d639]. artifact: a30f31a72b user: anonymous | |
LSORT -DICTIONARY does not honour number sign chirality
Closed / Rejected47e365d63990999828528ec13bdfa96861c70522Created 13 years agoUpdated 13 years ago
Descriptionplain2014-04-11 01:25:37
LSORT -DICTIONARY does NOT honour number sign chirality. % lsort -real -dict -inc [list 5 -7 53 54 55 50 51 -10 -9] -7 -9 -10 5 50 51 53 54 55 The negative numbers are ASCII sorted with the "-" in front, then rest of the chars (the digits) are sorted based on -increasing/-decreasing as if they were absolute values (the "-" applies as ASCII text NOT as part of the number). The -REAL flag works, but, the effect is negated with -DICTIONARY is used with it. (-real should override -dictionary in this case). This has been tested with TCL versions 8.5.11 and 8.6.1.
dkfhtml2014-04-11 14:51:51
The -dictionary option is working as designed; it only number-sorts digit sequences, and a “-” is sorted using the letter rule. For cases with mixed numbers and letters (including things like “X-123-ABC-789” which are the sorts of things that we've got to hope with) everything is correct. Yes, this means that you can't get numeric sorting in all cases.
Mixing -real with -dictionary is not recommended at all, but the last one used will take precedence.
Log in (anonymous is fine) to add a comment.