Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 282fa886e14decea1bc9150638fab30da16212e6
Ticket: 747083ffffffffffffffffffffffffffffffffff
lsearch -command tclcmd -group grpsize, lsort -group grpsiz
User & Date: kieranelby on 2008-08-29 23:36:24
Changes

  1. icomment:
    Logged In: YES 
    user_id=99072
    Originator: NO
    
    I've often thought the ability to directly sort a
    name-value style of list would be rather useful,
    and fancied some exercise in Tcl internals, so I've
    created patch 2082681 which adds a "-group" option to lsort:
    
    https://sourceforge.net/tracker/?func=detail&aid=2082681&group_id=10894&atid=310894
    
    When using -group in conjunction with the multiple index
    form of -index, it seemed to make most sense to have
    -group consume the first index given to -index, and
    use that as the offset within each group.
    
    e.g.
    % lsort -group 3 -index {0 1} \
        {{Bob Smith} 25 Audi {Jane Doe} 40 Ford}
    {{Jane Doe} 40 Ford {Bob Smith} 25 Audi}
    
    (since Smith is index 1 of element 0 of the first group of 3,
    and it sorts after Doe in the corresponding position in the
    2nd group of 3).
    
    I might get round to a patch for lsearch and a TIP at some
    point ...
    
    
    
  2. login: "kieranelby"
  3. mimetype: "text/plain"
  4. username: "kieranelby"