|
From: Andreas L. <av...@lo...> - 2008-11-23 19:17:21
|
On Sun, Nov 23, 2008 at 07:59:25PM +0200, Twylite wrote:
> The errorCode list is meant to be a hierarchy of error classes. If you
> specify the first element as "ARITH MATRIX" then it isn't a subclass of
> ARITH (which would be [list "ARITH" "MATRIX"]).
Yes, Donal made this clear, too, meanwhile.
I retract that particular example, but come up with a different
one instead.
Imagine an errorcode similar to
CHILDSTATUS pid code
except with further data after the code:
MYCHILDSTATUS pid code exectime text
which would also return the process's total execution time
in microseconds and some free text as well. It doesn't get thrown
now, but it sounds reasonable to be possibly thrown by some
user-defined "spawn" command.
With my suggestion of list-patterns, I could
handle {MYCHILDSTATUS * 1} {...}
and thusly safely handle exactly the cases where the
exit code was 1. (The list-pattern is shorter than
the code, and this would be defined to mean, that only
the first [llength $pattern] elements of errorCode
play a role, all others matching trivially.)
Maybe it falls into the 100- "80+%", but it just matches the
structure of errorCode better than string-based globbing.
Even if it is not considered for 8.6b1, I do hope it will
be in for 8.6.
|