|
From: Donal K. F. <don...@ma...> - 2008-11-23 17:47:31
|
Andreas Leitgeb wrote:
> Perhaps it's just me that I envision hierachies of error classes.
>
> Not being able to catch ARITH and all subclasses like a "ARITH MATRIX"
> with the same clause - just because the latter has list-meta-syntax that
> needs to be taken care of - feels just wrong to me.
What are you talking about? Apart from the fact that [list "ARITH
MATRIX" foo bar] isn't generating an ARITH code in the first place,
which is a bug in the *example*.
> If we specified the pattern to be applied only to [lindex $errorCode 0]
> or [join $errorCode], that would also solve the problem.
No it wouldn't. The first option would mean that in practical cases you
would only be able to trap POSIX or ARITH, not a subtype. The second
would mess up later words in the errorCode which *can* conventionally
contain spaces.
Subtype descriptors are separate words, as you would know if you'd ever
actually looked at them! Here's a couple of real examples:
$ tclsh8.5
% open nosuchfile
couldn't open "nosuchfile": no such file or directory
% set errorCode
POSIX ENOENT {no such file or directory}
$ tclsh8.6
% info nosuchopt
unknown or ambiguous subcommand "nosuchopt": must be [...]
% set errorCode
TCL LOOKUP SUBCOMMAND nosuchopt
(OK, I shortened the error message line...)
> Otherwise we'd have to discourage use of spaces and all other
> list-special characters in user defined errorcodes.
You're wrong. You're erecting a whole baroque architecture to deal with
something that just *is not a problem*. That's a good way to get no
respect at all from me...
Donal.
|