[Xotcl] Using instforward to wrap other packages

Michael Schlenker schlenk at uni-oldenburg.de
Thu Feb 23 16:56:26 CET 2006

Hi all,

i tried wrapping the ::struct::queue datastructure from Tcllib with a
simple XOTcl wrapper, but I'm unsure if there is a better way to setup
the instforwarder, it looks too complex to be really the best solution.

package require XOTcl
namespace import ::xotcl::*
package require struct::queue
Class Queue
Queue instproc init {args} {
	::struct::queue [self]::queue
Queue instforward clear eval {[self]::queue} clear
Queue instforward get eval {[self]::queue} get
Queue instforward peek eval {[self]::queue} peek
Queue instforward put eval {[self]::queue} put
Queue instforward unget eval {[self]::queue} unget
Queue instforward size eval {[self]::queue} size
Queue instproc destroy {args} {
	queue destroy

Any hints on how to do this in a nicer way?


More information about the Xotcl mailing list