Index: TODO =================================================================== diff -u -r96c8caae7c254b6b36f2c26fd6650cdfec792c4b -r2a3ac3f00afd5c5cfdfb1a9fff667cdec5b861be --- TODO (.../TODO) (revision 96c8caae7c254b6b36f2c26fd6650cdfec792c4b) +++ TODO (.../TODO) (revision 2a3ac3f00afd5c5cfdfb1a9fff667cdec5b861be) @@ -5457,14 +5457,14 @@ /obj/ configure -object-filter -> /obj/ configure -object-filters - added handling for calling relationslot with unknown sub method + +nx.tcl: +- make all __* system methods in nx redefine-protected +- let "nsf::configure objectsystem" return handles and protections as well + ======================================================================== TODO: -- is there a reason why Object::cleanup is not managed as a - object-system method; and not named "__cleanup" in NX?! - -- should __recreate also be redefine-protected in NX, as __alloc and __dealloc? - - finish pluaral reform - update migration guide and tutorial - maybe introdouce "allowabbrev" flag Index: generic/nsf.c =================================================================== diff -u -rc790d82b4b9e44e1d8e2a303e1d4931a91f049d8 -r2a3ac3f00afd5c5cfdfb1a9fff667cdec5b861be --- generic/nsf.c (.../nsf.c) (revision c790d82b4b9e44e1d8e2a303e1d4931a91f049d8) +++ generic/nsf.c (.../nsf.c) (revision 2a3ac3f00afd5c5cfdfb1a9fff667cdec5b861be) @@ -23866,7 +23866,17 @@ continue; } Tcl_ListObjAppendElement(interp, systemMethods, Tcl_NewStringObj(Nsf_SystemMethodOpts[idx], -1)); - Tcl_ListObjAppendElement(interp, systemMethods, osPtr->methods[idx]); + if (osPtr->handles[idx] || osPtr->protected[idx]) { + Tcl_Obj *listObj = Tcl_NewListObj(0, NULL); + Tcl_ListObjAppendElement(interp, listObj, osPtr->methods[idx]); + Tcl_ListObjAppendElement(interp, listObj, osPtr->handles[idx]); + if (osPtr->protected[idx]) { + Tcl_ListObjAppendElement(interp, listObj, Tcl_NewIntObj(1)); + } + Tcl_ListObjAppendElement(interp, systemMethods, listObj); + } else { + Tcl_ListObjAppendElement(interp, systemMethods, osPtr->methods[idx]); + } } Tcl_ListObjAppendElement(interp, osObj, systemMethods); Tcl_ListObjAppendElement(interp, list, osObj); Index: library/nx/nx.tcl =================================================================== diff -u -r275da34d3d7a874a451eced58242b738c8a37d1a -r2a3ac3f00afd5c5cfdfb1a9fff667cdec5b861be --- library/nx/nx.tcl (.../nx.tcl) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) +++ library/nx/nx.tcl (.../nx.tcl) (revision 2a3ac3f00afd5c5cfdfb1a9fff667cdec5b861be) @@ -58,7 +58,7 @@ -class.create create -class.dealloc {__dealloc ::nsf::methods::class::dealloc 1} -class.configureparameter __class_configureparameter - -class.recreate {__recreate ::nsf::methods::class::recreate} + -class.recreate {__recreate ::nsf::methods::class::recreate 1} -object.configure __configure -object.configureparameter __object_configureparameter -object.defaultmethod {defaultmethod ::nsf::methods::object::defaultmethod} Index: tests/method-require.test =================================================================== diff -u -rcd7387dce218900697565aeabc0e58afb0294a6a -r2a3ac3f00afd5c5cfdfb1a9fff667cdec5b861be --- tests/method-require.test (.../method-require.test) (revision cd7387dce218900697565aeabc0e58afb0294a6a) +++ tests/method-require.test (.../method-require.test) (revision 2a3ac3f00afd5c5cfdfb1a9fff667cdec5b861be) @@ -119,11 +119,12 @@ } # -# Test what happens if we try to redefine a "nonexistant" protected method. +# Test what happens if we try to redefine a "nonexistent" protected method. # -nx::test case method-require-scope { +nx::test case method-redefine-nonexistent { ? {nx::Class public method __alloc arg {return 1}} {refuse to overwrite protected method __alloc on ::nx::Class} ? {nx::Class public method __dealloc arg {return 1}} {refuse to overwrite protected method __dealloc on ::nx::Class} + ? {nx::Class public method __recreate arg {return 1}} {refuse to overwrite protected method __recreate on ::nx::Class} } # Index: tests/object-system.test =================================================================== diff -u -r275da34d3d7a874a451eced58242b738c8a37d1a -r2a3ac3f00afd5c5cfdfb1a9fff667cdec5b861be --- tests/object-system.test (.../object-system.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) +++ tests/object-system.test (.../object-system.test) (revision 2a3ac3f00afd5c5cfdfb1a9fff667cdec5b861be) @@ -19,7 +19,7 @@ } } -? {::nsf::configure objectsystem} "{::nx::Object ::nx::Class {-class.alloc __alloc -class.create create -class.dealloc __dealloc -class.configureparameter __class_configureparameter -class.recreate __recreate -object.configure __configure -object.configureparameter __object_configureparameter -object.defaultmethod defaultmethod -object.destroy destroy -object.init init -object.move move -object.unknown unknown}}" +? {::nsf::configure objectsystems} {{::nx::Object ::nx::Class {-class.alloc {__alloc ::nsf::methods::class::alloc 1} -class.create create -class.dealloc {__dealloc ::nsf::methods::class::dealloc 1} -class.configureparameter __class_configureparameter -class.recreate {__recreate ::nsf::methods::class::recreate 1} -object.configure __configure -object.configureparameter __object_configureparameter -object.defaultmethod {defaultmethod ::nsf::methods::object::defaultmethod} -object.destroy destroy -object.init {init ::nsf::methods::object::init} -object.move move -object.unknown unknown}}} ? {::nsf::object::exists nx::Object} 1 ? {::nsf::object::property nx::Object initialized} 1