Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get a list of all interpreters?

6 views
Skip to first unread message

George Petasis

unread,
May 27, 2006, 1:16:51 PM5/27/06
to
Hi all,

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

Michael Schlenker

unread,
May 27, 2006, 2:21:32 PM5/27/06
to
George Petasis schrieb:

> Hi all,
>
> Is there a way to get a list of all interpreters an application
> currently has?
If you know the master interpreter you can get all information about its
slaves.

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

George Petasis

unread,
May 27, 2006, 3:47:55 PM5/27/06
to Michael Schlenker
O/H Michael Schlenker έγραψε:

Now, is this a bug or a feature? :-)

George

Gerald W. Lester

unread,
May 27, 2006, 3:59:01 PM5/27/06
to

Correct behavior -- for security reasons.


--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+

George Petasis

unread,
May 27, 2006, 4:17:35 PM5/27/06
to Gerald W. Lester
O/H Gerald W. Lester έγραψε:

> George Petasis wrote:
>> O/H Michael Schlenker έγραψε:
>>> George Petasis schrieb:
>>>> Hi all,
>>>>
>>>> Is there a way to get a list of all interpreters an application
>>>> currently has?
>>> If you know the master interpreter you can get all information about its
>>> slaves.
>>>
>>> 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? :-)
>
> Correct behavior -- for security reasons.
>
>
I can understant that you cannot get this information from safe
interpreters, but I cannot see a reason why to not be able to have
this information from normal interpreters.

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

Jeff Hobbs

unread,
May 27, 2006, 6:26:27 PM5/27/06
to George Petasis, Gerald W. Lester
George Petasis wrote:
> 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 :-)

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

0 new messages