c::index - TclGetForIndex emulation
Welcome to Struct, a set of packages providing various data structures to Tcl, and additional operations for existing Tcl structures.
This package provides a replication of Tcl 8.5's internal function TclGetForIndex handling all forms of list indices, i.e. all of
INT
end
end-INT
INT+INT
INT-INT
This function replicates function TclGetForIndex.
The result is a Tcl status value (TCL_OK, TCL_ERROR).
It parses the data in objPtr, stores the resulting integer list index into the indexPtr and returns TCL_OK. It may change the Tcl_ObjType of objPtr.
In case of an error it returns TCL_ERROR, leaves an error message in the interp, and does not change indexPtr.
The endValue tells the function what value to use for end and related indices.
This package, written by Andreas Kupries, is BSD licensed.
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such at the Struct Tracker. Please also report any ideas for enhancements you may have for either package and/or documentation.
Data structures