Index: TODO =================================================================== diff -u -rfde244e7dcd51b61684ef569b87fbe15181b35cf -r18d88a73e8c4aed2496085bcd9202537b0f7930e --- TODO (.../TODO) (revision fde244e7dcd51b61684ef569b87fbe15181b35cf) +++ TODO (.../TODO) (revision 18d88a73e8c4aed2496085bcd9202537b0f7930e) @@ -2791,6 +2791,9 @@ TODO: +- adding of other slotcontainer properties in copy (see nx.tcl) +- remove debug output from parameters.test and nx.tcl + - missing in c-based "info slots": * handle object specific "info slots" in C? * "info slots", "info parameter" are not in the migration guide Index: generic/nsf.c =================================================================== diff -u -r5972bd087afec6d23d1192d552a29c92e570d8a6 -r18d88a73e8c4aed2496085bcd9202537b0f7930e --- generic/nsf.c (.../nsf.c) (revision 5972bd087afec6d23d1192d552a29c92e570d8a6) +++ generic/nsf.c (.../nsf.c) (revision 18d88a73e8c4aed2496085bcd9202537b0f7930e) @@ -10680,7 +10680,9 @@ Tcl_DStringAppend(dsPtr, prefix, -1); slotContainerObject = GetObjectFromString(interp, Tcl_DStringValue(dsPtr)); - if (slotContainerObject && slotContainerObject->nsPtr) { + if (slotContainerObject && slotContainerObject->nsPtr && + //(slotContainerObject->flags & NSF_IS_SLOT_CONTAINER) && + 1) { Tcl_HashSearch hSrch; Tcl_HashEntry *hPtr; Tcl_HashTable *cmdTablePtr = Tcl_Namespace_cmdTablePtr(slotContainerObject->nsPtr); @@ -19213,7 +19215,7 @@ /* * First add the per-object slot objects */ - if (1 && MethodSourceMatches(withSource, NULL, object)) { + if (MethodSourceMatches(withSource, NULL, object)) { AddSlotObjects(interp, object, "::per-object-slot", &slotTable, withSource, type, pattern, listObj); } Index: library/nx/nx.tcl =================================================================== diff -u -r5972bd087afec6d23d1192d552a29c92e570d8a6 -r18d88a73e8c4aed2496085bcd9202537b0f7930e --- library/nx/nx.tcl (.../nx.tcl) (revision 5972bd087afec6d23d1192d552a29c92e570d8a6) +++ library/nx/nx.tcl (.../nx.tcl) (revision 18d88a73e8c4aed2496085bcd9202537b0f7930e) @@ -425,10 +425,11 @@ set slotContainer ${baseObject}::$container if {![::nsf::object::exists $slotContainer]} { ::nx::Object ::nsf::methods::class::alloc $slotContainer + $slotContainer ::nsf::methods::object::requirenamespace ::nsf::method::property ${baseObject} -per-object $container call-protected true ::nsf::method::property ${baseObject} -per-object $container redefine-protected true + #puts stderr "::nsf::method::property ${baseObject} -per-object $container slotcontainer true" ::nsf::method::property ${baseObject} -per-object $container slotcontainer true - $slotContainer ::nsf::methods::object::requirenamespace } if {[info exists name]} { return ${slotContainer}::$name @@ -1520,11 +1521,11 @@ # attributes based on a list of parameter specifications. ################################################################## Class public method attributes arglist { - + puts stderr "+++ attributes calls nx::slotObj" + set slotContainer [::nx::slotObj [::nsf::self]] foreach arg $arglist { ::nx::MetaSlot createFromParameterSpec [::nsf::self] {*}$arg } - set slotContainer [::nx::slotObj [::nsf::self]] ::nsf::var::set $slotContainer __parameter $arglist } @@ -1703,6 +1704,14 @@ ::nsf::method::forward $dest $i {*}[$origin ::nsf::methods::class::info::forward -definition $i] } } + set parent [$origin ::nsf::methods::object::info::parent] + set method [namespace tail $origin] + if {$parent ne "::" && [::nsf::method::property $parent -per-object $method slotcontainer]} { + #puts stderr "$origin.$method is a slot container" + set p [$dest ::nsf::methods::object::info::parent] + ::nsf::method::property $p -per-object $method slotcontainer true + # TODO: add other slotcontainer properties as well, we should make a proc + } set traces [list] foreach var [$origin info vars] { Index: tests/parameters.test =================================================================== diff -u -r53e092b1dceccab3bbd0045bd5b14c1ddedaf68d -r18d88a73e8c4aed2496085bcd9202537b0f7930e --- tests/parameters.test (.../parameters.test) (revision 53e092b1dceccab3bbd0045bd5b14c1ddedaf68d) +++ tests/parameters.test (.../parameters.test) (revision 18d88a73e8c4aed2496085bcd9202537b0f7930e) @@ -1514,7 +1514,11 @@ Test parameter count 1 package req XOTcl + puts stderr ====1-[xotcl::Class ::nsf::methods::object::info::lookupmethod parameter] + puts stderr ====1-[nx::Object info method definition ::nsf::classes::xotcl::Class::parameter] + puts stderr ====1-[nx::Object info method definition ::nsf::classes::nx::Class::attributes] xotcl::Class create CC -parameter {package_id parameter_declaration user_id} + puts stderr ====2 # first, without list notation ? {CC create cc -package_id 123 -parameter_declaration o -user_id 4} "::cc"