|
From: Jos D. <jos...@gm...> - 2009-02-09 12:17:01
|
TIP #347: ADD 'STRING IS BIGNUM' TO THE 'STRING IS' SUBCOMMAND ================================================================ Version: $Revision: 1.2 $ Author: Jos Decoster <jos.decoster_at_gmail.com> State: Draft Type: Project Tcl-Version: 8.6 Vote: Pending Created: Monday, 09 February 2009 URL: http://purl.org/tcl/tip/347.html WebEdit: http://purl.org/tcl/tip/edit/347 Discussions-To: news:comp.lang.tcl Post-History: ------------------------------------------------------------------------- ABSTRACT ========== The *string* command supports tests for a number of Tcl's basic types, for example, integers, doubles, and booleans. This TIP proposes adding bignum integers, as was done for wide integers in [TIP #188]. RATIONALE =========== The *string* command includes tests for the common Tcl types: *string is boolean*, *string is double* and *string is integer*. Unaccountably, *string is bignum* is missing from the list, making it difficult for an input validation procedure to determine whether, in fact, a string contains a valid (bignum) integer. SPECIFICATION =============== This document proposes augmenting the *string is* command with a *string is bignum* that functions the same as *string is integer* in every respect except for the fact that it accepts any string containing a substring that is valid as a bignum integer (that is, acceptable to /Tcl_GetBignumFromObj/) possibly surrounded by whitespace. REFERENCE IMPLEMENTATION ========================== Patches that implement *string is bignum*, provide test cases for it, and update /doc/string.n/ to include it are available at SourceForge as Tcl Patch #2581150[<URL:https://sourceforge.net/support/tracker.php?aid=2581150>]. COPYRIGHT =========== This document has been placed in the public domain. ------------------------------------------------------------------------- TIP AutoGenerator - written by Donal K. Fellows |