Index: TODO =================================================================== diff -u -r45642e2495b4ab56937f7a7154feb6e507324fcc -r851e2c38fe3ae9d84f531605d55defe2e1308a02 --- TODO (.../TODO) (revision 45642e2495b4ab56937f7a7154feb6e507324fcc) +++ TODO (.../TODO) (revision 851e2c38fe3ae9d84f531605d55defe2e1308a02) @@ -1175,7 +1175,10 @@ when method is an object. - extend regression test -- backported fix for xotcl 1.6.6 reported by kristoffer lawsow, +- eliminated "info classparent" and "info classchildren" +- added tests to xotcl/tests/testx.xotcl to assure equivalence + +- backported fix for xotcl 1.6.6 reported by kristoffer lawson, which helps just partly here - extended regression test - added class ::nx::EnsembleObject @@ -1185,6 +1188,7 @@ - added tests/subcmd.tcl - added methods "defaultmethod" and "unknown" to ::nx::EnsembleObject (together with a set of helper methods to provide user-friendly information) +- scripted "info slotobjects" to return only objects of class ::nx::Slot TODO: - fix test "ob bar" (filter test) in tests/interceptor-slot.tcl (currently commented out) @@ -1194,13 +1198,16 @@ - deeper analysis of "contains" - unify SubcmdObj() and ParamCheckObj() handling? -- are "info class*" ops needed? - subcmd * handle sucmd for other method factories * handle introspection for subcmd nicely * handle absence of -create flag in resolve_method_path (for introspection) * consider alternate method name/place for subcmds on classes + - currently, "info slotobjects" returns only instances of ::nx::Slot + (the logic is scripted, otherwise, we would have to hardcode the name + nx::Slot). + - provide a different place in the namesspaces could simplify this - aliases on procs are a problem, when upvar is used (see info default/instdefault in xotcl2.tcl) Index: generic/xotcl.c =================================================================== diff -u -re4021ec17be539fb4d0e7547bd9e93cece90fd49 -r851e2c38fe3ae9d84f531605d55defe2e1308a02 --- generic/xotcl.c (.../xotcl.c) (revision e4021ec17be539fb4d0e7547bd9e93cece90fd49) +++ generic/xotcl.c (.../xotcl.c) (revision 851e2c38fe3ae9d84f531605d55defe2e1308a02) @@ -14219,9 +14219,12 @@ static int XOTclObjInfoSlotObjectsMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *pattern) { XOTclObjects *pl, *slotObjects; Tcl_Obj *list = Tcl_NewListObj(0, NULL); + /*XOTclClass *slotClass = XOTclpGetClass(interp, "::nx::Slot");*/ slotObjects = computeSlotObjects(interp, object, pattern /* not used */, 1); + for (pl=slotObjects; pl; pl = pl->nextPtr) { + /*if (slotClass && !isSubType(pl->obj->cl, slotClass)) continue;*/ Tcl_ListObjAppendElement(interp, list, pl->obj->cmdName); } Index: library/nx/nx.tcl =================================================================== diff -u -re4021ec17be539fb4d0e7547bd9e93cece90fd49 -r851e2c38fe3ae9d84f531605d55defe2e1308a02 --- library/nx/nx.tcl (.../nx.tcl) (revision e4021ec17be539fb4d0e7547bd9e93cece90fd49) +++ library/nx/nx.tcl (.../nx.tcl) (revision 851e2c38fe3ae9d84f531605d55defe2e1308a02) @@ -847,7 +847,15 @@ :alias "info mixin classes" ::nsf::cmd::ObjectInfo2::mixinclasses :alias "info parent" ::nsf::cmd::ObjectInfo2::parent :alias "info precedence" ::nsf::cmd::ObjectInfo2::precedence - :alias "info slotobjects" ::nsf::cmd::ObjectInfo2::slotobjects + :method "info slotobjects" {} { + set result [list] + foreach slot [::nsf::dispatch [::nsf::current object] ::nsf::cmd::ObjectInfo2::slotobjects] { + puts stderr "check $slot [::nsf::objectproperty $slot type ::nx::Slot]" + if {![::nsf::objectproperty $slot type ::nx::Slot]} continue + lappend result $slot + } + return $result + } :alias "info vars" ::nsf::cmd::ObjectInfo2::vars }