<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE TIP SYSTEM "http://tcl.tk/cgi-bin/tct/tip/tipxml.dtd">
<!-- Converted at Tue May 21 02:28:11 GMT 2013 -->
<!-- TIP AutoGenerator - written by Donal K. Fellows -->

<TIP number='56'>
<header><title>Standardize Call Interface to Tcl_Eval* Functions</title><author address="mailto:msofer@users.sourceforge.net">Miguel Sofer</author><status type='project' state='final' tclversion="8.4" vote='after'>$Revision: 1.4 $</status><history></history><created day='28' month='aug' year='2001' /></header>
<abstract>This TIP replaces <emph style="italic">Tcl_EvalTokens</emph> with <emph style="italic">Tcl_EvalTokensStandard</emph>, which obeys the standard result management conventions for script evaluation functions.</abstract>
<body><section title="Rationale">
<para>The standard call interface for <emph style="italic">Tcl_Eval*</emph> 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 <emph style="italic">Tcl_EvalTokens</emph>, 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 <emph style="italic">Tcl_EvalTokens</emph> with a new function <emph style="italic">Tcl_EvalTokensStandard</emph> that performs the same chores but adheres to the standard call interface.</para>
<para>There are two arguments for the replacement of <emph style="italic">Tcl_EvalTokens</emph>:</para>
<itemize><item.i><para>Present a consistent call interface to all <emph style="italic">Tcl_Eval*</emph> functions.</para></item.i><item.i><para>Allow the return of non-error exceptional returns when evaluating tokens; the impossibility to do this is the cause of Bugs #455151 (<url ref="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=455151&amp;group_id=10894&amp;atid=110894"/>) and #219384 (<url ref="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=219384&amp;group_id=10894&amp;atid=110894"/>)</para></item.i></itemize>
</section>
<section title="Proposed Change">
<para>The proposal is to deprecate the use of <emph style="italic">Tcl_EvalTokens</emph> and replace it with a new <emph style="italic">Tcl_EvalTokensStandard</emph>. The core should only use the new function, the old one remains only for backward compatibility with extensions.</para>
<para>The proposal is implemented in the patch included in [Bug: 455151] <url ref="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=455151&amp;group_id=10894&amp;atid=110894"/></para>
</section>
<section title="Copyright">
<para>This document has been placed in the public domain.</para>
</section>
</body></TIP>
