Master and Slave - slave alias procs act in master 
Author Message
 Master and Slave - slave alias procs act in master

So, I have a problem/thing I'm confused about.

I create some procs in a master interpreter.  These procs create
global variables and affect the state of the interpreter.

I create aliases to these procs in a slave interpreter.  However I
didn't follow the logic that these aliases *would act on the master
interpreter*.  I now understand that after some debugging, but I still
want the other behaviour - I want the procs to act on the slave
interpreter.  Should I just recreate them?  Should I just give up on
the idea of having this be a slave interp (I'm doing things from C, so
it doesn't really have to be a slave...).  

Once again: it would be really nice to have somethin like a
Tcl_CreateSlaveDuplicateResources, so that my new interp has all the
stuff that was in the old one...

Ideas?
--
David N. Welton
     Personal:           http://www.*-*-*.com/ ~davidw/  
Free Software:           http://www.*-*-*.com/ ~davidw/
   Apache Tcl:           http://www.*-*-*.com/



Wed, 04 Jun 2003 02:47:31 GMT  
 Master and Slave - slave alias procs act in master

Quote:
> I create some procs in a master interpreter.  These procs create
> global variables and affect the state of the interpreter.

> I create aliases to these procs in a slave interpreter.  However I
> didn't follow the logic that these aliases *would act on the master
> interpreter*.  I now understand that after some debugging, but I still
> want the other behaviour - I want the procs to act on the slave
> interpreter.  Should I just recreate them?  Should I just give up on
> the idea of having this be a slave interp (I'm doing things from C, so
> it doesn't really have to be a slave...).  

You have correctly found that the aliases are designed to be run
in the originating (not calling) interpreter (it's not always the
master, it could be totally different).

What I do in tkcon (it makes heavy uses of aliases and master/slave
interpreter communication) is to add the slave name in the aliases
that want to do magic there, so they can interp eval what they need.
If you really just want copies of the procs in the slave, then just
make copies of the procs.  You can see this also done in tkcon.

Jeff



Tue, 24 Jun 2003 03:26:49 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using master/slave windows

2. LOGO-L> Masters and slaves

3. Master-Slave Register

4. Verilog models for STD-32 bus masters/slaves

5. Problems with a Gate Level Master-Slave JK Flip Flop

6. master-slave JK flip flop vhdl model need

7. Master and Slave and Los Angeles

8. create unsafe slave from unsafe master

9. Master and slave widget

10. How to make a window at the same time a Slave and a Master

11. Unexpected result from [slave alias srcCmd {}]

12. Slave interpreters and command aliases ?bug?

 

 
Powered by phpBB® Forum Software