View · Search · Index
No registered users in community xowiki
in last 10 minutes

[Xotcl] Using instforward to wrap other packages

From: Michael Schlenker <schlenk_at_uni-oldenburg.de>
Date: Thu, 23 Feb 2006 16:56:26 +0100

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} {
        next
        ::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
        next
}

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

Michael