\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#56: Standardize Call Interface to Tcl\_Eval* Functions}
\date{August 28, 2001}
\author{Miguel Sofer}
\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 \#56}&\textbf{Standardize Call Interface to Tcl\_Eval* Functions}\\\hline
Author&

Miguel Sofer \tipmail{msofer}{users.sourceforge.net}
\\
Created&Tuesday, \(\text{28}^{\text{th}}\) August 2001\\
Type&Project\\
Tcl Version&\(8.4\)\\
State&Final\\
Vote&Done\\
Version&\tipversion$Revision: 1.4 $\\
Post History&\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

This TIP replaces \textit{Tcl\_EvalTokens} with \textit{Tcl\_EvalTokensStandard}, which obeys the standard result management conventions for script evaluation functions.
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{Rationale}

The standard call interface for \textit{Tcl\_Eval*} functions returns a Tcl completion code (TCL\_OK, TCL\_ERROR, TCL\_RETURN, TCL\_BREAK, or TCL\_CONTINUE), and sets a result object in the interpreter. The single exception is the function \textit{Tcl\_EvalTokens}, that returns a pointer to the result object, or a NULL when an exception occurs. This effectively transforms all exceptions into errors. This TIP proposes to replace \textit{Tcl\_EvalTokens} with a new function \textit{Tcl\_EvalTokensStandard} that performs the same chores but adheres to the standard call interface.

There are two arguments for the replacement of \textit{Tcl\_EvalTokens}:
\begin{itemize}
\item{}
Present a consistent call interface to all \textit{Tcl\_Eval*} functions.
\item{}
Allow the return of non-error exceptional returns when evaluating tokens; the impossibility to do this is the cause of Bugs \#455151 (\url{https://sourceforge.net/tracker/index.php?func=detail&aid=455151&group_id=10894&atid=110894}) and \#219384 (\url{https://sourceforge.net/tracker/index.php?func=detail&aid=219384&group_id=10894&atid=110894})
\end{itemize}

\section{Proposed Change}

The proposal is to deprecate the use of \textit{Tcl\_EvalTokens} and replace it with a new \textit{Tcl\_EvalTokensStandard}. The core should only use the new function, the old one remains only for backward compatibility with extensions.

The proposal is implemented in the patch included in [Bug: 455151] \url{https://sourceforge.net/tracker/index.php?func=detail&aid=455151&group_id=10894&atid=110894}

\section{Copyright}

This document has been placed in the public domain.

\section{Colophon}

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