Index: library/nx/nx.tcl =================================================================== diff -u -rd9d84c89e05b9bd5cc02b37725ce32a7f08ec2ad -r46c2dd2bc59f23a473cbbc42f4731f0cb5f4df83 --- library/nx/nx.tcl (.../nx.tcl) (revision d9d84c89e05b9bd5cc02b37725ce32a7f08ec2ad) +++ library/nx/nx.tcl (.../nx.tcl) (revision 46c2dd2bc59f23a473cbbc42f4731f0cb5f4df83) @@ -832,18 +832,27 @@ # Define "info info" and "info unknown" ###################################################################### - proc ::nx::internal::infoOptions {obj} { - #puts stderr "INFO INFO $obj -> '[::nsf::directdispatch $obj ::nsf::methods::object::info::methods -type all]'" - set methods [list] + ::nsf::proc ::nx::internal::infoOptions {-asList:switch obj {methods ""}} { + # puts stderr "INFO INFO $obj -> '[::nsf::directdispatch $obj ::nsf::methods::object::info::methods -type all]'" + foreach name [::nsf::directdispatch $obj ::nsf::methods::object::info::methods] { - if {$name eq "unknown"} continue + if {$name in $methods || $name eq "unknown"} continue lappend methods $name } - return "valid options are: [join [lsort $methods] {, }]" + + if {$asList} { + return $methods + } else { + return "valid options are: [join [lsort $methods] {, }]" + } } - Object method "info info" {} {::nx::internal::infoOptions ::nx::Object::slot::__info} - Class method "info info" {} {::nx::internal::infoOptions ::nx::Class::slot::__info} + Object method "info info" {-asList:switch} { + ::nx::internal::infoOptions -asList=$asList ::nx::Object::slot::__info + } + Class method "info info" {-asList:switch} { + ::nx::internal::infoOptions -asList=$asList ::nx::Class::slot::__info [next {info -asList}] + } # finally register method for "info method" (otherwise, we cannot use "method" above) Class eval {