Skip to content
Tcl Source Code History Of Ticket 689652ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 689652ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 689652ffffffffffffffffffffffffffffffffff

  1. Ticket change [42dd07842d] (rid 116446) by vincentdarley on 2003-02-19 23:06:10:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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!
      
      
      
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "vincentdarley"
    9. subsystem initialized to: "17. Commands I-L"
    10. title initialized to: "lsearch fuller functionality (and small doc bug)"
    11. type initialized to: "RFE"
  2. Ticket change [b9e3c5e126] (rid 129224) by vincentdarley on 2003-02-20 16:01:01:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      One more comment, 'lsearch' always searches from the 
      front of the list.  Why not '-last' (or -reverse) flag?
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  3. Ticket change [4314b1935f] (rid 116484) by dkf on 2003-02-20 22:46:45:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Jeff got rid of that doc bug last August. :^)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. title changed to: "lsearch fuller functionality"
    5. username: "dkf"
  4. Ticket change [658fb774f4] (rid 102572) by vincentdarley on 2003-02-27 19:47:28:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      Comments from tcl-core:
      
      On Thu, 27 Feb 2003, Michael Schlenker wrote:
      > Looks also reasonable, but I note, that your "illegal" -
      sorted + pattern
      > examples do work...
      
      Indeed, now I see they do, but they *ignore* the '-
      sorted' flag.  This
      contradicts what is in the man page, where '-sorted' is 
      explicitly
      mutually exclusive with -glob and -regexp.  I think an 
      error should be
      thrown for illegal flag combinations.
      
      The man page really ought to specify what happens in 
      this case, and also
      in the case where the list isn't sorted but '-sorted' is 
      given (even if
      only to say the behaviour is undefined).
      
      Currently using '-all' tends to hide all these problems 
      because the
      implementation with -all is brute force (I doesn't use 
      the fact that
      -sorted could still provide a benefit).
      
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  5. Ticket change [376067c5be] (rid 107264) by dkf on 2003-02-27 23:31:53:

    1. resolution changed to: "Rejected"
    2. status changed to: "Closed"
  6. Ticket change [ffa5612401] (rid 108783) by dkf on 2003-02-27 23:31:54:

    1. closedate changed to: "2003-02-27T16:31:54"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      You *can't* mix glob matching and specialised sorting
      handling.  This is because you can only tell whether a glob
      pattern matches or not, and not whether there cannot be a
      match before the given entry because of that.  Consider the
      glob pattern *[abyz]?[cdx]* - how could you even begin to
      combine that with an ordering criterion?!
      
      Similar problems with -regexp, of course.
      
      With -all, you have a similar thing in that it is really
      designed for use with -glob and -regexp.  Is the case of an
      exact search of sorted non-unique list all that common?
      
      Maybe could do with a new -prefix option; prefix matching
      *would* be compatible with -sorted.  Backwards searching
      would be another nice feature.  Please open a new FRQ or
      submit a TIP if you want to take them further.
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. username: "dkf"
  7. Ticket change [129e56fbdb] (rid 124062) by dkf on 2007-01-14 22:36:21:

    1. is_private changed to: "1"