Is there a way to get a list of all interpreters an application
currently has? Can this be done from a safe interpreter?
Is there a solution with tcl code? A solution from the C API?
For example, running in tkcon "interp slaves {}"
returns nothing. However, I think that when you start tkcon, there
are at least two interpreters. Is there a way to get the names of
these interpreters and to execute commands into them?
George
Can this be done from a safe interpreter?
Per definition a safe interpreter can only introspect its children,
never its master.
> Is there a solution with tcl code? A solution from the C API?
No. I don't think the C-API provides anything, you could find it with
some deep hacking, as all interps share some resources (std channels,
env variable) and you could try to find the structures in memory, but i
don't think that is a sane idea.
>
> For example, running in tkcon "interp slaves {}"
> returns nothing. However, I think that when you start tkcon, there
> are at least two interpreters. Is there a way to get the names of
> these interpreters and to execute commands into them?
Not if your interp is below them in the interp hierarchy.
Michael
Now, is this a bug or a feature? :-)
George
Correct behavior -- for security reasons.
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
I need this functionality to overcome a bug in Tk. The tileqt extension
registers a generic xevent handler in each interpreter that is loaded.
But due to a bug in the Tk, only the last registered event handler gets
called. I thought that I could write a tcl proc that will propagate the
needed changes to all other interpreters that have tileqt loaded, but I
cannot get the list of all the interpreters :-)
George
How about we correct the bug in Tk rather than break the strict
hierarchy of the interp model? (which is correct and good, IMO)
Jeff