Advertisement
yyamasak

Get list of XOTcl objects

Sep 9th, 2024
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.25 KB | Source Code | 0 0
  1. proc get_all_objects {{cls Class}} {
  2.     set instances [list]
  3.     foreach instance [$cls info instances] {
  4.         if {[$instance isclass]} {
  5.             lappend instances {*}[get_all_objects $instance]
  6.         } else {
  7.             lappend instances $instance
  8.         }
  9.     }
  10.     return $instances
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement