On 6/29/07, Mike Cowlishaw <MFC@...> wrote:
> [Sorry for the delay, was at Arith18 all this week, with almost no e-mail
> connectivity. Just back in UK...]
> > One of the things I've never liked about Trace I is the difficulty
> > of mapping the various output bits back to the source of the trace
> > data. For example, from this little snippet,
> > What are the values of the variables PAT, OUT, IN and what do each
> > of the functions return? It is necessary to sort of "reverse
> > execute" the expression to figure this out. And the more
> > complicated the expression, the more difficult it becomes.
> > Additionally, when I ran this, my first reaction was there was a bug
> > in TRACE I since it seemed to repeat each subelement with an ">>>"
> > entry. I had to use the debugger to figure out that those repeated
> > entries were the argument value results getting traced, which are
> > controlled by "TRACE R", not "TRACE I".
> > Anyway, I'm thinking it might be nice to get some additional context
> > information added to the trace output, such as the variable names,
> > function names, message names, etc. It might be nice to have a
> > special code for argument expression results to highlight those. So
> > this output might look like this:
> > 6 *-* say translate(reverse(left(pat, 7)), out, in)
> > >V< "PAT"
> > >V> "ci$$@!c*)(&"
> > >,> "ci$$@!c*)(&"
> > >L> "7"
> > >,> "7"
> > >F< "LEFT"
> > >F> "ci$$@!c"
> > >,> "ci$$@!c"
> > >F< "REVERSE"
> > >F> "c!@$$ic"
> > >,> "c!@$$ic"
> > >V< "OUT"
> > >V> "las"
> > >,> "las"
> > >V< "IN"
> > >V> "!@$"
> > >,> "!@$"
> > >F< "TRANSLATE"
> > >F> "classic"
> > >>> "classic"
> > Where the ">*<" entries give information about the entry that
> > follows it and ">,>" is an argument expression result (replacing ">>>").
> > Is this too much output? I'm open to suggestions too on how the
> > prefixes for the additional information should be handled.
> This adds new & obscure 'tags', and also doesn't make it very clear what
> goes with what. And quotes around symbols is quite confusing. Why not
> have something like 'trace extra' (spelling tbd :-)) and then just add the
> variable/function name after the value:
> 6 *-* say translate(reverse(left(pat, 7)), out, in)
> >V> "ci$$@!c*)(&" PAT
> >,> "ci$$@!c*)(&"
> >L> "7"
> >,> "7"
> >F> "ci$$@!c" LEFT
> >,> "ci$$@!c"
> >F> "c!@$$ic" REVERSE
> >,> "c!@$$ic"
> >V> "las" OUT
> >,> "las"
> >V> "!@$" IN
> >,> "!@$"
> >F> "classic" TRANSLATE
> >>> "classic"
> In fact if this is not an 'always happen', switched, thing, then could put
> the name first:
> >V> OUT = "las"
> >F> REVERSE => "c!@$$ic"
I'd considered doing something like that originally, but was concerned with
potentially breaking programs that analyzed trace output :-) I do sort of
think that's a good idea and will take a look at it. I'd prefer the names
to lead things off, since longer values will make it difficult to easily
spot that information. The one difficult one to implement this way is the
compound variables, since the ">C>" element is traced before the variable is
accessed, and the result is later, and because of ways variable accesses get
optimized, that original information's no longer available. Perhaps the
">C>" element could trace things as '>C> A.N => "A.1"', then show a variable
element using '>V> A.N = "Fred"'.
Also I might be tempted to use >A> for >,> ('A' for Arg being more
> memorable than ',' and the latter having several possible meanings.)
I tossed a coin on this one originally, no big deal to change it.
(Hmm, and don't forget Trace Var :-) .. output consistent/extendable with
> that would be good.)
Trace Var? ooRexx doesn't have a Trace Var.
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> Oorexx-devel mailing list