Index: generic/nsf.c =================================================================== diff -u -r9f32dd2c379759ca82cf9b49dcc9c62af01f5cc8 -r41559ade739ad3f4f4282d7b2626f850cfdef9c6 --- generic/nsf.c (.../nsf.c) (revision 9f32dd2c379759ca82cf9b49dcc9c62af01f5cc8) +++ generic/nsf.c (.../nsf.c) (revision 41559ade739ad3f4f4282d7b2626f850cfdef9c6) @@ -4850,7 +4850,7 @@ * Don't allow overwriting of an object with an method. */ return NsfPrintError(interp, - "cannot overwrite child object with method %s; delete/rename it before overwriting", + "refuse to overwrite child object with method %s; delete/rename it before overwriting", methodName); } ok = (Tcl_Command_flags(cmd) & NSF_CMD_REDEFINE_PROTECTED_METHOD) == 0; @@ -4868,7 +4868,7 @@ */ Tcl_Obj *bootstrapObj = Tcl_GetVar2Ex(interp, "::nsf::bootstrap", NULL, TCL_GLOBAL_ONLY); if (bootstrapObj == NULL) { - result = NsfPrintError(interp, "method '%s' of %s cannot be overwritten; " + result = NsfPrintError(interp, "refuse to overwrite protected method '%s'; " "derive e.g. a sub-class!", methodName, ObjectName(object)); } else { result = TCL_OK; @@ -22167,7 +22167,7 @@ * We have a cmd, but no object. Don't allow to overwrite an ordinary * cmd by an nsf object. */ - result = NsfPrintError(interp, "cannot overwrite cmd %s; delete/rename it before overwriting", nameString); + result = NsfPrintError(interp, "refuse to overwrite cmd %s; delete/rename it before overwriting", nameString); goto create_method_exit; } } Index: tests/protected.test =================================================================== diff -u -rf61ee3dfc17d8cf04a0dc9ada9cb0f939514a511 -r41559ade739ad3f4f4282d7b2626f850cfdef9c6 --- tests/protected.test (.../protected.test) (revision f61ee3dfc17d8cf04a0dc9ada9cb0f939514a511) +++ tests/protected.test (.../protected.test) (revision 41559ade739ad3f4f4282d7b2626f850cfdef9c6) @@ -114,39 +114,39 @@ ? {::nsf::method::property C foo redefine-protected true} 1 ? {C method SET {a b c} {...}} \ - {method 'SET' of ::C cannot be overwritten; derive e.g. a sub-class!} \ + {refuse to overwrite protected method 'SET'; derive e.g. a sub-class!} \ "redefine method SET" ? {C method foo {a b c} {...}} \ - {method 'foo' of ::C cannot be overwritten; derive e.g. a sub-class!} \ + {refuse to overwrite protected method 'foo'; derive e.g. a sub-class!} \ "redefine method foo" # check a predefined protection ? {::nx::Class method create {a b c} {...}} \ - {method 'create' of ::nx::Class cannot be overwritten; derive e.g. a sub-class!} \ + {refuse to overwrite protected method 'create'; derive e.g. a sub-class!} \ "redefine method create" # try to redefine predefined protected method via alias ? {::nsf::method::alias nx::Class create ::set} \ - {method 'create' of ::nx::Class cannot be overwritten; derive e.g. a sub-class!} \ + {refuse to overwrite protected method 'create'; derive e.g. a sub-class!} \ "redefine alias create" # try to redefine via forward ? {C forward SET ::set} \ - {method 'SET' of ::C cannot be overwritten; derive e.g. a sub-class!} \ + {refuse to overwrite protected method 'SET'; derive e.g. a sub-class!} \ "redefine forward SET" # try to redefine via setter ? {C property SET} \ - {method 'SET' of ::C cannot be overwritten; derive e.g. a sub-class!} \ + {refuse to overwrite protected method 'SET'; derive e.g. a sub-class!} \ "redefine property SET" # redefine-protect object specific method nx::Object create o o method foo {} {return 13} ::nsf::method::property o foo redefine-protected true ? {o method foo {} {return 14}} \ - {method 'foo' of ::o cannot be overwritten; derive e.g. a sub-class!} + {refuse to overwrite protected method 'foo'; derive e.g. a sub-class!} } Index: tests/submethods.test =================================================================== diff -u -r17ad6747e40c1724810371f92f0108b12c1d5284 -r41559ade739ad3f4f4282d7b2626f850cfdef9c6 --- tests/submethods.test (.../submethods.test) (revision 17ad6747e40c1724810371f92f0108b12c1d5284) +++ tests/submethods.test (.../submethods.test) (revision 41559ade739ad3f4f4282d7b2626f850cfdef9c6) @@ -325,7 +325,7 @@ ? {obj foo} {wrong # args: should be ":info"} # now we overwrite the object specific method with an object - ? {Object create obj::info} "cannot overwrite cmd ::ns1::obj::info; delete/rename it before overwriting" + ? {Object create obj::info} "refuse to overwrite cmd ::ns1::obj::info; delete/rename it before overwriting" rename obj::info "" ? {Object create obj::info} ::ns1::obj::info ? [list obj $infolookup info] ::ns1::obj::info