Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d315be1fe14dcd1790e441398acbc144bb29ffca10b47ae301fc2c1cf565ebab
Ticket: fa00fbbbabe2d77904ac0086884d5debf9c529a5
lseq / lindex discrepancies
User & Date: apnadkarni on 2023-04-12 14:31:09
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    I expect lindex with indices larger than list size to return empty string. This is the case with small lseq ranges but not large ones (64-bit build)
    
    ```
    % lindex [lseq 0x10] 0x11 -> correctly returns empty string
    % lindex [lseq 0x7fffffff] 0x80000000  -> generates error instead
    index 2147483648 is out of bounds 0 to 2147483646
    %
    ```
    
    Another possibly related (on 32-bit build)
    
    ```
    % lindex [lseq 0xffffffff] 0x80000000 -> should return 2147483648
    %
    ```
    
    This last may be related to signed/unsigned indexing and may go away with TIP 660.
    
    Finally, some check (and exception) is needed when list limit is exceeded. The following on *32-bit* Tcl should generate an error since the full range of elements cannot be accessed by indexing.
    
    ```
    % llength [lseq 0x100000000]
    0
    ```
    
    I have not tried this on the tip-636 branch.
    
    /Ashok
    
  5. foundin changed to: "9.0"
  6. is_private changed to: "0"
  7. login: "apnadkarni"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "9546e9877f1a8899e25a89082561ee694e7fb402"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "apnadkarni"
  14. subsystem changed to: "- New Builtin Commands"
  15. title changed to: "lseq / lindex discrepancies"
  16. type changed to: "Bug"