[Xotcl] Device chaining from Objects/Classes defined in C

Scott Gargash scottg at atc.creative.com
Sat Sep 23 22:01:57 CEST 2006


xotcl-bounces at alice.wu-wien.ac.at wrote on 09/15/2006 12:28:50 PM:

> I have some classes that are defined in C using the xotcl (cersion 
> 1.4) C API.  Things seem to work (I can create objects and invoke 
> methods), but I can't get chaining to function.  I can invoke the 
> "next" command (using Tcl_Eval( interp, "xotcl::next")), but that 
> fails with "next: can't find self" 

Just a followup for anybody searching the mailing list archives. 

XOTcl requires the Tcl stack to contain information about the executing 
object in order to resolve the net method.  By default, and prior to 
1.5.1, C methods do not annotate the Tcl stack with the approriate 
information to allow method chaining to work.

As of 1.5.1, C methods can be registered with an additional flag, 
XOTCL_NONLEAF_METHOD.  When a method with this flag is invoked the Tcl 
stack will include the information needed to allow "next" to function 
properly.

In addition to the new flag, 1.5.1 exports a couple of additional C 
functions to improve the performance of the XOTcl at the C-interface. 

XOTclNextObjCmd() -  invoke "xotcl::next" at the C-level without an 
additional interpreter evaluation
XOTclCallMethodWithArgs() - invoke a method without an additional 
interpreter evaluation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://alice.wu-wien.ac.at/pipermail/xotcl/attachments/20060923/f088dbbc/attachment.html


More information about the Xotcl mailing list