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

Re: [Xotcl] Unforwarding object method

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Mon, 13 Mar 2006 21:43:40 +0100

Scott Gargash schrieb:
>
> Hello,
>
> I've just started looking at XOTcl over the last couple days, and so
> far I like it a lot. Since I'm still learning, I assume I've
> overlooked something in the documentation, but I can't find how to
> remove a forwarded method from an object. It seems that all I can do
> is add a forwarded method, but once installed, I can never unforward a
> method. Is this true?
>

Hi Scott,

i am not exactly sure, what you have in mind with your example.
However, a forwarder in xotcl is a c-implemented method. Therefore it can
be deleted like every other method by

   <obj> proc <method> {} {}
   <class> instproc <method> {} {}

below is a simple example derived from yours...

best regards
-gustaf neumann
=========================================
Object a
a proc foo {args} {
  puts "[self] foo"
}

Class C
C instproc foo args {
  puts "[self] default foo"
}

C b
b foo
puts "start forwarding to a"
b forward foo a %proc

b foo
puts "stop forwarding to a"
b proc foo {} {}
b foo