Tcl Source Code

Check-in [ce47ead183]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:TclOO: Remove unneeded name manipulation from TclOOCopyObjectCmd.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-branch
Files: files | file ages | folders
SHA3-256: ce47ead1831928fd9cce6eebd03d73257497da29abd0d671a3c72f002799c262
User & Date: pooryorick 2017-12-26 12:27:14
Context
2018-02-15
09:47
TclOO: Remove unneeded name manipulation from TclOOCopyObjectCmd. check-in: 14b283bfc2 user: pooryorick tags: pyk-TclOO
2017-12-28
18:51
merge core-8-6-branch check-in: e7cb6182f1 user: jan.nijtmans tags: core-8-branch
16:53
merge core-8-branch check-in: c358266fda user: jan.nijtmans tags: no-wideint
2017-12-27
20:24
merge core-8-branch. Re-implement Tcl_WinTCharToUtf/Tcl_WinUtfToTChar using only win32 API. check-in: 465d5c8195 user: jan.nijtmans tags: tip-389
14:09
merge 8.7 check-in: 329ff8f395 user: dgp tags: tip-445
2017-12-26
17:27
merge core-8-branch check-in: 59e7da9c29 user: pooryorick tags: pyk-TclOO
12:54
TclOO: Remove unneeded name manipulation from TclOOCopyObjectCmd. check-in: 6f87ca4212 user: pooryorick tags: trunk
12:27
TclOO: Remove unneeded name manipulation from TclOOCopyObjectCmd. check-in: ce47ead183 user: pooryorick tags: core-8-branch
03:32
Merged core-8-6-branch: replace ifdef TCLDIR with compare against empty string check-in: b8024b4d83 user: apnadkarni tags: core-8-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclOOBasic.c.

1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
....
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
     * [oo::define] command.
     */

    if (objc == 2) {
	o2Ptr = Tcl_CopyObjectInstance(interp, oPtr, NULL, NULL);
    } else {
	const char *name, *namespaceName;
	Tcl_DString buffer;

	name = TclGetString(objv[2]);
	Tcl_DStringInit(&buffer);
	if (name[0] == '\0') {
	    name = NULL;
	} else if (name[0]!=':' || name[1]!=':') {
	    Interp *iPtr = (Interp *) interp;

	    if (iPtr->varFramePtr != NULL) {
		Tcl_DStringAppend(&buffer,
			iPtr->varFramePtr->nsPtr->fullName, -1);
	    }
	    TclDStringAppendLiteral(&buffer, "::");
	    Tcl_DStringAppend(&buffer, name, -1);
	    name = Tcl_DStringValue(&buffer);
	}

	/*
	 * Choose a unique namespace name if the user didn't supply one.
	 */

	namespaceName = NULL;
................................................................................
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"%s refers to an existing namespace", namespaceName));
		return TCL_ERROR;
	    }
	}

	o2Ptr = Tcl_CopyObjectInstance(interp, oPtr, name, namespaceName);
	Tcl_DStringFree(&buffer);
    }

    if (o2Ptr == NULL) {
	return TCL_ERROR;
    }

    /*






<


<


<
<
<
<
<
<
<
<
<
<







 







<







1202
1203
1204
1205
1206
1207
1208

1209
1210

1211
1212










1213
1214
1215
1216
1217
1218
1219
....
1227
1228
1229
1230
1231
1232
1233

1234
1235
1236
1237
1238
1239
1240
     * [oo::define] command.
     */

    if (objc == 2) {
	o2Ptr = Tcl_CopyObjectInstance(interp, oPtr, NULL, NULL);
    } else {
	const char *name, *namespaceName;


	name = TclGetString(objv[2]);

	if (name[0] == '\0') {
	    name = NULL;










	}

	/*
	 * Choose a unique namespace name if the user didn't supply one.
	 */

	namespaceName = NULL;
................................................................................
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"%s refers to an existing namespace", namespaceName));
		return TCL_ERROR;
	    }
	}

	o2Ptr = Tcl_CopyObjectInstance(interp, oPtr, name, namespaceName);

    }

    if (o2Ptr == NULL) {
	return TCL_ERROR;
    }

    /*