TIP 626: Command arguments > 2^31 elements

Login
Bounty program for improvements to Tcl and certain Tcl packages.
    Author:        Jan Nijtmans <jan.nijtmans@gmail.com>
    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.

Specification

Starting with Tcl/Tk 9.1, the following 6 functions are declared deprecated:

  • Tcl_CreateCommand
  • Tcl_CreateObjCommand
  • Tcl_CreateTrace
  • Tcl_CreateObjTrace
  • Tcl_NRCallObjProc
  • Tcl_NRCreateCommand

In favor of:

  • Tcl_CreateObjCommand2
  • Tcl_CreateObjTrace2
  • Tcl_NRCallObjProc2
  • Tcl_NRCreateCommand2

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.

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 and Itcl will need to be modified. nsf is in active development, but Itcl isn't any more. Therefore, Itcl will no longer be distributed with Tcl 9.1 (unless someone steps up who wants to do this work).

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.

History