[Xotcl] Unforwarding object method

Gustaf Neumann neumann at wu-wien.ac.at
Mon Mar 13 21:43:40 CET 2006


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



More information about the Xotcl mailing list