TIP 746: Remove "expr" behavior from lseq

Login
Bounty program for improvements to Tcl and certain Tcl packages.
    Author:        Brian Griffin <briang42@easystreet.net>
    State:         Final
    Type:          Project
    Vote:          Done
    Created:       15-01-2026
    Tcl-Version:   9.0
    Tcl-Branch:    lseq_bug_fixes
    Vote-Summary:  Accepted 6/1/0
    Votes-For:     BG, JN, SL, AN, HO, MC
    Votes-Against: DP
    Votes-Present: 

Abstract

TIP 629 added the lseq command to Tcl. This tip proposes removing the "expr" feature of lseq, that allows expressions as valid arguments to the command. This feature is problematic for well known reasons.

Rationale and Discussion

Evaluating arguments as expressions opens the door for potential mischief code to be executed. Beyond that, it can also produce potentially confusing error messages in some situations. A better design is to make expression evaluation more explicit when writing tcl code.

See this ticket for side effects of "expr" behavior: Ticket-8d1fc70995

Proposal

Remove the checks and calls to expression evaluation from the command. I propose making this change in Tcl version 9.0.x, but this may not be acceptable. Therefore, this TIP requests a vote for 9.0 or 9.1 for implementing the proposed change.

Implementation

The relevant code will be removed, and related regression tests modified or removed. The documentation updated accordingly as well.

Compatibility

Any existing use of expressions in lseq will report an appropriate error message.

Discussion

Copyright

This document has been placed in the public domain.

History