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

Re: [Xotcl] Using instforward to wrap other packages

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Thu, 23 Feb 2006 18:08:54 +0100

For now, the best coming up my mind is:

   Class Queue -parameter {{queue [self]::queue}}
   Queue instproc init {} {
     ::struct::queue [my queue]
   }
   foreach cmd {clear get peek put unget size} {
     Queue instforward $cmd {%my queue} %proc
   }
   Queue instproc destroy {} {
     [self]::queue destroy
     next
  }

or you can try this road:

  Class Queue
   Queue instproc init {} {
     set queue [self]::queue
     ::struct::queue $queue
     my forward clear $queue %proc
     my forward get $queue %proc
     my forward put $queue %proc
     my forward peek $queue %proc
     my forward unget $queue %proc
     my forward size $queue %proc
   }
   Queue instproc destroy {} {
     [self]::queue destroy
     next
   }

guess, we have currently no shortcut to address a child of the current
instance. suggestions for making things nicer are always welcome...

-gustaf