Index: TODO =================================================================== diff -u -r18d88a73e8c4aed2496085bcd9202537b0f7930e -rb9c2616a2eeb214fffba66f91b993435ac6d4045 --- TODO (.../TODO) (revision 18d88a73e8c4aed2496085bcd9202537b0f7930e) +++ TODO (.../TODO) (revision b9c2616a2eeb214fffba66f91b993435ac6d4045) @@ -2789,6 +2789,11 @@ * generalized slot object handling. * extended regression test +- xotcl2:tcl + * made "info heritage" in xotcl2 compatible with xotcl1 + * fixed "info slots" in xotcl2 + * extended regression test + TODO: - adding of other slotcontainer properties in copy (see nx.tcl) Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -r1f7ecfcf5b0643ce05b96405c77d5da7fe10268e -rb9c2616a2eeb214fffba66f91b993435ac6d4045 --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 1f7ecfcf5b0643ce05b96405c77d5da7fe10268e) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision b9c2616a2eeb214fffba66f91b993435ac6d4045) @@ -646,7 +646,11 @@ #puts "--- var '$varName' level=[info level]" return $r } - :alias heritage ::nsf::methods::class::info::heritage + :proc heritage {pattern:optional} { + set cmd [list ::nsf::methods::class::info::superclass -closure] + if {[info exists pattern]} {lappend cmd $pattern} + return [my {*}$cmd] + } :alias instances ::nsf::methods::class::info::instances :proc instargs {method} {::xotcl::info_args class [self] $method} @@ -708,6 +712,7 @@ return [my {*}$cmd] } :alias parameter ::nx::Class::slot::__info::attributes + :alias slots ::nx::Class::slot::__info::slots :alias subclass ::nsf::methods::class::info::subclass :alias superclass ::nsf::methods::class::info::superclass } Index: library/xotcl/tests/slottest.xotcl =================================================================== diff -u -r1f7ecfcf5b0643ce05b96405c77d5da7fe10268e -rb9c2616a2eeb214fffba66f91b993435ac6d4045 --- library/xotcl/tests/slottest.xotcl (.../slottest.xotcl) (revision 1f7ecfcf5b0643ce05b96405c77d5da7fe10268e) +++ library/xotcl/tests/slottest.xotcl (.../slottest.xotcl) (revision b9c2616a2eeb214fffba66f91b993435ac6d4045) @@ -144,6 +144,24 @@ # ::xotcl::MetaSlot create Role -superclass Attribute -parameter {references} +::nx::Test case info-slots-heritage { + ::xotcl::Class create C -parameter {c1 c2} + ::xotcl::Class create D -superclass C -parameter {c2 c3} + + ? {C info heritage} "::xotcl::Object" + ? {D info heritage} "::C ::xotcl::Object" + + # xotcl info heritage should not see the mixins + C instmixin [::xotcl::Class create M] + ? {C info superclass -closure} "::xotcl::Object" + ? {D info superclass -closure} "::C ::xotcl::Object" + ? {D info heritage} "::C ::xotcl::Object" + + ? {C info slots} "::C::slot::c1 ::C::slot::c2" + ? {D info slots} "::D::slot::c2 ::D::slot::c3" + ? {D info slots -closure -source application} "::D::slot::c2 ::D::slot::c3 ::C::slot::c1" +} + ###################### # application classes ######################