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

Re: [Xotcl] Missing -nocomplain in [unset]

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Sun, 23 Oct 2005 12:53:15 +0200

Kristoffer Lawson schrieb:

> Well, the subject says it all. That Tcl option seems to be missing
> from the XOTcl equivalent.

hmm, somehow we missed the introduction of this flag to tcl's unset.

Fortunately, this is quite simple to get this working in current xotcl.
Add the following line
to your script, and you are set.

    ::xotcl::Object instforward unset -objscope

Performancewise, this seems fine as well. Unless i have done something
stupid in my timings, it looks to me that we can drop our c-implementation
of unset.

check the following code:

   ::xotcl::Object sample
   set cmd {time {time {sample set xxx 1; sample unset xxx} 100000} }

    puts "orig set+unset [eval $cmd]"

  ::xotcl::Object instforward unset -objscope

   puts "new set+unset [eval $cmd]"


on my mac os x notebook, the version based on instforward is constantly
slightly faster than the original c-implemented version, where i don't see
at the first sight the performance eater (using the nested
time to get more precise timings).

If noone complains and this version survives our testing, I'll drop the
c-code and add this version for the next release.

all the best
-gustaf

PS: for now, you can add the instforward line to predefined.xotcl.