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

Re: [Xotcl] Send NULL arg to Class constructor

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Tue, 28 Apr 2009 08:44:44 +0200

Ross, Colin schrieb:
> Hi Gustaf - thanks so much for your prompt response. The "instproc configure" is perfect for what I need to do. I do appologise for not being able to find it in the documentation - I guess if you dont know what you are looking for then its difficult to find it.
>
>
One can alway ask XOTcl, what's going on. The tiny script below shows
the call-order for creates and recreates.

best regards
-gustaf neumann


==== create
CALL ::C ::xotcl::Class->create c1
CALL ::C ::xotcl::Class->alloc ::c1
EXIT ::C ::xotcl::Class->alloc (::c1)
CALL ::c1 ::xotcl::Object->configure
EXIT ::c1 ::xotcl::Object->configure (0)
CALL ::c1 ::xotcl::Object->init
EXIT ::c1 ::xotcl::Object->init ()
EXIT ::C ::xotcl::Class->create (::c1)
==== recreate
CALL ::C ::xotcl::Class->create c1
CALL ::C ::xotcl::Class->recreate ::c1
CALL ::c1 ::xotcl::Object->cleanup
EXIT ::c1 ::xotcl::Object->cleanup ()
CALL ::c1 ::xotcl::Object->configure
EXIT ::c1 ::xotcl::Object->configure (0)
CALL ::c1 ::xotcl::Object->init
EXIT ::c1 ::xotcl::Object->init ()
EXIT ::C ::xotcl::Class->recreate (::c1)
EXIT ::C ::xotcl::Class->create (::c1)
DONE

===================================================
package req XOTcl
namespace import -force ::xotcl::*

Object instproc F args {
  puts "CALL [self] [self calledclass]->[self calledproc] $args"
  set r [next]
  puts "EXIT [self] [self calledclass]->[self calledproc] ($r)"
  return $r
}

Class C -instfilter F -filter F

puts "==== create"
C create c1

puts "==== recreate"
C create c1

puts DONE