TIP #347 Version 1.7: Align 'string is ...' to Type-Conversion Functions in 'expr'

This is not necessarily the current version of this TIP.


TIP:347
Title:Align 'string is ...' to Type-Conversion Functions in 'expr'
Version:$Revision: 1.7 $
Author:Jos Decoster <jos dot decoster at gmail dot com>
State:Draft
Type:Project
Tcl-Version:8.7
Vote:Pending
Created:Monday, 09 February 2009
Discussions To:news:comp.lang.tcl
Keywords:Tcl

Abstract

The string command supports tests for a number of Tcl's basic types, for example, integers, doubles, and booleans. The tcl::mathfunc mathematical functions provides sevaral functions to limit the number of bits used in integer numbers. This TIP proposes to align both groups of functions for int, long, wide and entier.

Rationale

The string command includes tests for the common Tcl types: string is boolean, string is double and string is integer. Some of the integer ranges used in Tcl internals are missing from the list, making it difficult for an input validation procedure to determine whether, in fact, a string contains a valid integer number to be used for that specific Tcl command.

Ranges already present are:

Missing ranges are:

The ::tcl::mathfunc mathematical functions provides sevaral functions to limit the number of bits used in integer numbers. Some of the integer ranges used in Tcl internals are missing from the list, and other check an unexpected range.

Functions already present are:

Functions already present but with unexpected behavior are:

Missing functions are:

Providing a string is function for every integer range used in Tcl internals will make it possible to check every argument in input validation procedures before call