Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ad3ef2c2d6a64f378bbceab5378def0ef9db42c0
Ticket: 747083ffffffffffffffffffffffffffffffffff
lsearch -command tclcmd -group grpsize, lsort -group grpsiz
User & Date: nobody on 2003-06-01 17:17:57
Changes

  1. assignee changed to: "nijtmans"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    improve lsearch by adding a  -command tclcmd option 
    to search list items using the same function as lsort
    
    e.g.
      set L [lsort -command CompareVector $L]
      set X [lsearch -sorted -command CompareVector $L]
    
    also some grouping would be great:
    think you have a list with every 4 items belong to a 
    group and you wanna sort it by the third item:
    e.g. 
    set L { a0 a1 a2 a3  b0 b1 b2 b3  c0 c1 c2 c3 .. }
    
    to sort using lsort you have to make a list of lists by
      set L2 {}
      foreach {a b c d} { lappend L2 [list $a $b $c $d] }
      set L2 [lsort -index 2 $L2]
      set L [concat $L2]
    
    a faster approach with the nonexisting -group option
      set L [lsort -group 4 -index 2 $L]
    
    searching such lists is required than as well so
      lsearch -group 4 -index 2 $L  c2
    
    will return 2 the group number (my favourite, or 10 as the 
    real index, or 8 as the first member of the group)
    
    such grouped lists are very general in my opinion, 
    because regexp,array get,split are functions that may 
    return such lists
    
    finally a quick   "lreverse list" command would be a nice 
    idea.
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: ""
  10. title changed to:
    lsearch -command tclcmd -group grpsize,  lsort -group grpsiz
    
  11. type changed to: "Support"