Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d15eca42034c411cb713270d892da3551bd77624da8afcf392aed29e431e9098
Ticket: bc4ac0dd5f4c87677ea45fb5b480894630e3c5fb
lsearch -sorted -inline -subindices incorrect result
User & Date: sebres on 2024-11-18 17:56:53
Changes

  1. icomment:
    <blockquote> And it would break a use case I often use ;-( </blockquote>
    
    Well, it'd not (directly): you just not need to use -subindices together with -inline (see example at end), it was never anticipated to use it in this way (since the option -subindices was only considered without -inline), so one can consider it as a regression, but rather it is consistent now and it was just never documented and rather unexpected previously.
    
    Now since -stride and -subindices (with -inline) is considered to be documented (and TIPed) behaviour, it also affected -inline without -stride.
    
    I guess it is expected behaviour now (and better now), but needs to be fixed in any case (to return correct sub-element).
    
    I'll fix it soon...
    
    Back to your particular example, you have to use it simply without -subindices (since it was and is a bit unexpected):
    
    ```diff
    - set help [lindex [lsearch -index 0 -inline -subindices $helplist $switch] 1]
    + set help [lindex [lsearch -index 0 -inline $helplist $switch] 1]
    ```
    Of course this will belong to the migration notes too.
    
  2. login: "sebres"
  3. mimetype: "text/x-markdown"