The use of chain command in itcl make the response for command very slow when i want to chain the whole class which was inherited, so is there any other way i can use the base class functions thank using the chain command in itcl?
itcl::class Toaster {
variable crumbs 0
method toast {nslices} {
if {$crumbs > 50} {
error "== FIRE! FIRE! =="
}
set crumbs [expr $crumbs+4*$nslices]
}
method clean {} {
set crumbs 0
}
}
itcl::class SmartToaster {
inherit Toaster
method toast {nslices} {
if {$crumbs > 40} {
clean
}
return [Toaster::toast $nslices]
}
}
itcl::class SmartToaster {
inherit Toaster
method toast {nslices} {
if {$crumbs > 40} {
clean
}
return [chain $nslices]
}
}
The above is the example, where they have used chain, but in my case the class "Toaster" which has huge lot many methods and procs, atleast 50 methods and 10 procs which is making chain to operate slower. so any alternative to this?