\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#395: New 'string is entier' Command}
\date{December 13, 2011}
\author{Jos Decoster}
\urlstyle{sf}
\setlength{\parskip}{1ex}
\setlength{\parindent}{0pt}
\def\tipversion$#1${\texttt{\$#1\$}}
\def\tiplangle#1{\ensuremath{<}}
\def\tiprangle#1{\ensuremath{>}}
\def\tipbar#1{\ensuremath{|}}
\def\tipmail#1#2{\(\langle\){\small\expandafter\url{#1@#2}}\(\rangle\)}
\ifx\pdfoutput\undefined
\newcommand{\tipimage}[2]{\typeout{Make sure you download #1.eps}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.eps}}{\includegraphics[width=0.8\textwidth]{#1.eps}}}
\newcommand{\tipxref}[1]{}
\newcommand{\tipxrefend}{}
\else
\newcommand{\tipimage}[2]{\typeout{Make sure you create #1.pdf}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.pdf}}{\includegraphics[width=0.8\textwidth]{#1.pdf}}}
\pdfcatalog{/PageMode /UseOutlines}
\newcommand{\tipxref}[1]{\pdfannotlink attr {/C [0.5 0.5 1.0] /Border [0 0 1]} goto name {#1}}
\newcommand{\tipxrefend}{\pdfendlink}
\fi
\newenvironment{tipabstract}{\begin{abstract}}{\end{abstract}}
\begin{document}\maketitle
\begin{center}\begin{tabularx}{\linewidth}{|r@{: }X|}\hline
\textbf{TIP \#395}&\textbf{New 'string is entier' Command}\\\hline
Author&

Jos Decoster \tipmail{jos.decoster}{gmail.com}
\\
Created&Tuesday, \(\text{13}^{\text{th}}\) December 2011\\
Type&Project\\
Tcl Version&\(8.6\)\\
State&Final\\
Vote&Done\\
Version&\tipversion$Revision: 1.5 $\\
Keywords&Tcl\\
Obsoletes&347\\
Post History&\\
Discussions To&news:comp.lang.tcl\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

The \textbf{string is} command supports tests for a number of Tcl's basic types, for example, integers, doubles, and booleans. One common case is missing: checking if a value is an integer number without particular storage width, unlike \textbf{string is integer} and \textbf{string is wideinteger}. This document proposes to augment the \textbf{string is} command with a \textbf{string is entier}.
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{Rationale}

Tcl makes it easy to work with integers larger than 64 bit (big nums). The \textbf{expr} command supports operations on unlimited bit widths. Checking if a string contains a valid integer value is possible with the \textbf{string is integer} and \textbf{string is wideinteger} commands for integers of particular storage widths (e.g. 32 bit for integers and 64 bit for wide integers). But checking if a string contains a valid integer wider than a \textbf{wideinteger} is not possible with a \textbf{string is} command. Checking if a string contains a valid big num can now be done with a regular expression or by \textbf{catch}-ing the \textbf{::tcl::mathfunc::entier} function.

\section{Specification}

This document proposes to augment the \textbf{string is} command with a \textbf{string is entier} which functions the same as \textbf{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 \textit{Tcl\_GetBignumFromObj}) possibly surrounded by whitespace.

\section{Compatibility}

No incompatibilities are introduced.

\section{Alternatives}

The \textbf{bignum} was rejected in favor of \textbf{entier} because \textbf{entier} is already used in \textbf{::tcl::mathfunc::entier}.

\section{Reference Implementation}

A reference implementation is available here:

 \url{http://sites.google.com/site/josdecoster/Home/tip_string_is_entier.diff}

\section{Copyright}

This document has been placed in the public domain.

\section{Colophon}

\textit{TIP AutoGenerator --- written by Donal K. Fellows}
\end{document}
