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

Re: [Xotcl] generating error stacks messages from xotcl

From: Uwe Zdun <uwe.zdun_at_uni-essen.de>
Date: Wed, 10 Oct 2001 10:27:14 +0200

Hi,

from 0.9 on we will execute in the calling namespace instead of the object
namespace. The "downside" is that you cannot do

 TestA instproc fooB {} {
   fooC
 }

anymore because you do not execute in TestA's namespace. The benefits are:

- you don't have to write :: to access global commands (e.g.
  if you want to ::set something in an instproc of ::Object).
- you can "compose" commands, like
  X instproc myli c {
    [em [li $c]]
    p
  }
- Thus, if you always have to use self, the problem below disappears.
  Without this we would not be able to provide the same debug infos because
  we have no control over the tcl command dispatch mechanism

However, the second problem you mention (with [[self] next])
is still there. We have discussed this and think that we should forbid [self]
next as well, so that next calls are never dispatched as method calls. This
seems to be a cleaner language design (since [self] next is rather for
backwards compatibility and as we are approaching version 1.0 we should
better get rid of it).

--uwe


On Saturday 06 October 2001 02:24 pm, you wrote:
> Hallo
>
> For XotclIDE I have built a Error Stack browser witch can parse
> error messages (in errorInfo) a convert it to methods list.
>
> I have following problem. Consider the example
>
> Class TestA
> TestA instproc fooA {} {
> [self] fooC
> }
> TestA instproc fooB {} {
> fooC
> }
> TestA instproc fooC {} {
> error {error from fooC}
> }
>
> TestA a
> a fooA
>
> generate following errorInfo
> error from fooC
> while executing
> "error {error hier}"
> (procedure "fooC" line 2)
>
> ::sample0 ::TestA->fooC
>
> invoked from within
> "[self] fooC"
> (procedure "fooA" line 2)
>
> ::sample0 ::TestA->fooA
>
> invoked from within
>
> a fooB # generate following message
>
> error from fooC
> while executing
> "error {error hier}"
> (procedure "fooC" line 2)
> invoked from within
> "fooC"
> (procedure "fooB" line 2)
>
> ::sample0 ::TestA->fooB
>
> invoked from within
>
> I the first example we have the lines
> (procedure "fooC" line 2)
>
> ::sample0 ::TestA->fooC
>
> This can be good used for parsing errorInfo
> I the second there are only
> (procedure "fooC" line 2)
> The same bahavior is by method chains with "next" or filter methods.
>
> Can the xotcl be changed for same dubug infos?
>
> Artur Trzewik
> _______________________________________________
> Xotcl mailing list - Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl

-- 
Uwe Zdun
Institute for Computer Science, University of Essen
Phone: +49 201 81 00 332, Fax: +49 201 81 00 398
zdun_at_{xotcl,computer,acm}.org, uwe.zdun_at_uni-essen.de