Index: generic/nsf.c =================================================================== diff -u -r3ccbf1417d84765af57693523035ecf857e37428 -r1dad927c0b8c125b98c185b5ffa7b3b7eb947e66 --- generic/nsf.c (.../nsf.c) (revision 3ccbf1417d84765af57693523035ecf857e37428) +++ generic/nsf.c (.../nsf.c) (revision 1dad927c0b8c125b98c185b5ffa7b3b7eb947e66) @@ -17031,14 +17031,15 @@ /* * Retrieve the newly defined proc */ - Namespace *execNsPtr; - Proc *procPtr = FindProcMethod(nsPtr, methodName); + Proc *procPtr = FindProcMethod(nsPtr, methodName); if (procPtr != NULL) { - /* modify the cmd of the proc to set the current namespace for the body */ + Namespace *execNsPtr; + if (withInner_namespace == 1) { /* - * Set the namespace of the method as inside of the class. + * Set the execution namespace to the registration object (e.g. same + * as the class). */ if (regObject->nsPtr == NULL) { MakeObjNamespace(interp, regObject); @@ -17050,16 +17051,17 @@ execNsPtr = (Namespace *)regObject->nsPtr; } else { /* - * Set the namespace of the method to the same namespace the cmd of - * the defObject has. + * Set the execution namespace of the method to the same namespace the + * cmd of the defObject has. */ - execNsPtr = ((Command *)regObject->id)->nsPtr; + execNsPtr = ((Command *)regObject->id)->nsPtr; } ParamDefsStore((Tcl_Command)procPtr->cmdPtr, parsedParam.paramDefs, checkAlwaysFlag, (Tcl_Namespace *)execNsPtr); Tcl_SetObjResult(interp, MethodHandleObj(defObject, withPer_object, methodName)); result = TCL_OK; + } else { result = TCL_ERROR; NsfLog(interp, NSF_LOG_WARN,