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

Re: [Xotcl] Changing method name and Filters

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Wed, 29 Aug 2001 13:47:12 +0200

On Wednesday 29 August 2001 00:05, Sheik Yussuff wrote:
> Is there a way for one filter (A say) to change the name of a method
> and pass this new method name with the same args to the next
> filter in sequence(B say)?

 you want to call from D->f1 via next the method C->f2?

 Class C
 C instproc f1 ....
 C instproc f2
 Class D -superclass C
 D instproc f1 {} {
    next
 }

 no, you can't do it. you can do certainly the following:

  D instproc f1 {} {
    if {....some-condition...} {
       [self] f2
    } else {
      next
    }
 }

 -gustaf
PS: there is a way to call methods of a class directly,
but i won't recommend it, since it is going to change in the
next releaese, when XOTcl will be a well behaved extension, and
everything is moved into the xotcl namespace