summaryrefslogtreecommitdiffstats
path: root/generic/tclTestObj.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-11-14 23:17:02 (GMT)
committerhobbs <hobbs>2001-11-14 23:17:02 (GMT)
commitb169ab6f788a7a93a3bf7f020e9709305307a516 (patch)
treee2099b7a9dc4bb4dc572f484ee86baf5db2c28ae /generic/tclTestObj.c
parente0ad658bcf279bc60cce5e2a7f3d58d7f4d26420 (diff)
downloadtcl-b169ab6f788a7a93a3bf7f020e9709305307a516.zip
tcl-b169ab6f788a7a93a3bf7f020e9709305307a516.tar.gz
tcl-b169ab6f788a7a93a3bf7f020e9709305307a516.tar.bz2
Reference implementation of TIP's #22, #33 and #45. Adds the
ability of the [lindex] command to have multiple index arguments, and adds the [lset] command. Both commands are byte-code compiled. [Patch #471874] (work by Kenny, commited by Hobbs)
Diffstat (limited to 'generic/tclTestObj.c')
-rw-r--r--generic/tclTestObj.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c
index 8232175..d423308 100644
--- a/generic/tclTestObj.c
+++ b/generic/tclTestObj.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTestObj.c,v 1.7 2000/11/24 11:27:37 dkf Exp $
+ * RCS: @(#) $Id: tclTestObj.c,v 1.8 2001/11/14 23:17:04 hobbs Exp $
*/
#include "tclInt.h"
@@ -774,6 +774,19 @@ TestobjCmd(clientData, interp, objc, objv)
varPtr[i] = NULL;
}
}
+ } else if ( strcmp ( subCmd, "invalidateStringRep" ) == 0 ) {
+ if ( objc != 3 ) {
+ goto wrongNumArgs;
+ }
+ index = Tcl_GetString( objv[2] );
+ if ( GetVariableIndex( interp, index, &varIndex ) != TCL_OK ) {
+ return TCL_ERROR;
+ }
+ if (CheckIfVarUnset(interp, varIndex)) {
+ return TCL_ERROR;
+ }
+ Tcl_InvalidateStringRep( varPtr[varIndex] );
+ Tcl_SetObjResult( interp, varPtr[varIndex] );
} else if (strcmp(subCmd, "newobj") == 0) {
if (objc != 3) {
goto wrongNumArgs;