TIP 626: Command arguments ≻ 2^31 elements

Login
    Author:        Jan Nijtmans <[email protected]>
    State:         Draft
    Type:          Project
    Vote:          Pending
    Created:       24-05-2022
    Tcl-Version:   9.1
    Keywords:      Tcl
    Tcl-Branch:    tip-626

Abstract

This TIP proposes to change Tcl internally, to use Tcl_CreateObjCommand2() and friends (TIP #627), and to change all internal handling, allowing > 2^31 command line elements. This doesn't change any API (since the API is already available), but it has some consequences.

Rationale

The new functions in TIP #627 allow any list to be converted to a command, without worrying about the length of the list. It completes the conversion of Tcl and Tk, using Tcl_Size internally in stead of int, everywhere.

Example:

% set s [string cat {*}[lrepeat 0x100000000 x]]; string length $s            
4294967296

Specification

Starting with Tcl/Tk 9.1, the following 8 functions (and 3 for Itcl) are declared deprecated:

In favor of (already existing):

This means that new development should not use those deprecated functions any more, but there is no penalty: No warning will be generated when using any of those functions in extensions. All of those functions still work as before.

It also means that - due to the internal changes - some extensions which depend on the internal behavior won't work any more as-is. Especially nsf will need to be modified.

For extensions which only depend on the public API, everything works as before.

Implementation

See branch tip-626

Copyright

This document has been placed in the public domain.