I’m doing a simple TCL lsort using the -nocase flag. However, one system where I’m running that code is still using TCL 8.4, where the nocase isn’t available. Is there any simple workaround, or will I have to manually handle this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
TCL 8.4 has the -dictionary flag, which provides case-insensitive comparisons. If your strings contain no digits on it, I think the behaviour is equal to the -nocase flag.
From the documentation:
-dictionary
Use dictionary-style comparison. This is the same as -ascii except (a) case is ignored except as a tie-breaker and (b) if two strings contain embedded numbers, the numbers compare as integers, not characters. For example, in -dictionary mode, bigBoy sorts between bigbang and bigboy, and x10y sorts between x9y and x11y.
-nocase
Causes comparisons to be handled in a case-insensitive manner. Has no effect if combined with the -dictionary, -integer, or -real options.
http://www.hume.com/html85/mann/lsort.html