Diff
Not logged in

Differences From Artifact [73054c5f3f]:

To Artifact [9553446160]:


7230
7231
7232
7233
7234
7235
7236















































7237
7238
7239
7240
7241
7242
7243
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







	if (restart) {
	    /* A trace existed on a variable we touched, so we must rescan. */
	    goto restartScan;
	}
    }
    return TCL_OK;
}

/*
 * ----------------------------------------------------------------------
 *
 * TclCreateConstantInNS --
 *
 *	Create a constant in a given namespace. Does nothing if the variable
 *	already exists. The variable name should not indicate an array element;
 *	it should be a simple name as the namespace is given by other means.
 *
 * Results:
 *	Tcl result code.
 *
 * Side effects:
 *	May run traces.
 *
 * ----------------------------------------------------------------------
 */
int
TclCreateConstantInNS(
    Tcl_Interp *interp,
    Namespace *nsPtr,		/* The namespace to contain the constant. */
    Tcl_Obj *nameObj,		/* The unqualified name of the constant. */
    Tcl_Obj *valueObj)		/* The value to put in the constant. */
{
    Interp *iPtr = (Interp *) interp;
    Namespace *savedNsPtr = iPtr->varFramePtr->nsPtr;
    Var *varPtr, *arrayPtr;

    iPtr->varFramePtr->nsPtr = nsPtr;
    varPtr = TclObjLookupVarEx(interp, nameObj, NULL,
	    (TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG | TCL_AVOID_RESOLVERS),
	    "write", /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr);
    iPtr->varFramePtr->nsPtr = savedNsPtr;
    if (arrayPtr) {
	Tcl_Panic("constants may not be arrays");
    }
    if (!varPtr) {
	return TCL_ERROR;
    }
    if (TclIsVarUndefined(varPtr)) {
	varPtr->value.objPtr = valueObj;
	Tcl_IncrRefCount(valueObj);
	varPtr->flags |= VAR_CONSTANT;
    }
    return TCL_OK;
}

/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End: