AW: Re: [Xotcl] Using instforward to wrap other packages

mail at xdobry.de mail at xdobry.de
Fri Feb 24 08:40:13 CET 2006


Hi!

Learnable lazy wrapper per unknown mechanism.
Should one do such magic thinks?

package require XOTcl
namespace import ::xotcl::*
package require struct::queue

Class Queue -parameter {{queue [self]::queue}}

Queue instproc init {} {
    ::struct::queue [my queue]
}
Queue instproc destroy {} {
   [self]::queue destroy
   next
}
Queue instproc unknown {args} {
   # some debbug
   puts "learning [lindex $args 0]"
   Queue instforward [lindex $args 0] {%my queue} %proc
   # maybe learn only if that calls success
   eval [self]::queue $args
}

Testing

(bin) 31 % Queue create q1
::q1
(bin) 32 % q1 put 32
learning put
(bin) 33 % q1 put 43
(bin) 34 % q1 get
learning get
32
(bin) 35 % q1 get
43
(bin) 35 % 

Artur


More information about the Xotcl mailing list