Overview
| Artifact ID: | 42dd07842d7868dd0e025dd8120cbf301df83b9e |
|---|---|
| Ticket: | 689652ffffffffffffffffffffffffffffffffff
lsearch fuller functionality |
| User & Date: | vincentdarley on 2003-02-19 23:06:10 |
Changes
- assignee changed to: "dkf"
- cmimetype changed to: "text/plain"
- comment changed to:
Recent versions of Tcl introduced the '-sorted', and '-all' flags to lsearch (with associated flags '- ascii', '-dictionary', 'integer', etc). However, many combinations are disallowed, and some of the implementation could be made more efficient. For example 'lsearch -sorted -all' doesn't do a binary search, claiming (in the code) "note that there is no point in being smart when -all was specified; in that case, we have to look at all items anyway". But that isn't true, one could do a forward and a backward binary search and then return the remaining range (or do a forward binary search and then a forward negated binary search from that point). Another problem is that one can't use any form of pattern with '-sorted', which would be very useful. For example these useful examples are illegal: lsearch -sorted -glob -- "aaaa aabb aabc aacc abcc" "aab*" would (if the list was much longer, like a dictionary) return 1, and: lsearch -sorted -glob -all -- "aaaa aabb aabc aacc abcc" "aab*" would return "1 2" (and with '-inline' this would be a nice way of efficiently returning just the relevant 'lrange'). Finally, I point out that several examples at the bottom of the lsearch man page use a '-data' option which is not in Tcl at all!
- foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "vincentdarley"
- subsystem changed to: "17. Commands I-L"
- title changed to: "lsearch fuller functionality (and small doc bug)"
- type changed to: "RFE"