|
From: Joe E. <jen...@fl...> - 2008-11-20 18:18:39
|
Twylite wrote:
>
> First up, I want to be clear about the intent behind TIP #329:
> a) The TIP is about error handling, not exception handling. Tcl has
> excellent exception handling which can be readily used in a mostly
> non-ugly way (e.g. catch + if/then/else or catch + switch),
[ FWIW, I don't fully agree. TIP#89 made correct exception
handling _possible_, but it's still not very convenient or pretty.
That's why I think it's essential that TIP#239 support exception
handling as well, not just error handling. Especially since it
can easily do so with only minor changes. ]
> but its error handling is poor.
Full agreement here.
> > I don't like the alternative approach [to try/finally] much either,
> > simply because it smells too much like innovation.
> >
> And there I was thinking that Tcl generally supported innovation ;p
Again: I think the alternative approach sounds interesting
and is worth pursuing, just *not in this TIP*, and *not right now*.
We have a short deadline for 8.6.
[Elsewhere]
Neil Madden wrote:
[ re: error handling ]
> I believe this is already addressed by the presence of errorCode.
> Pattern-matching against this code is already quite simple, with
> [switch] and so on. It just hasn't caught on. It seems like wishful
> thinking to expect that it will suddenly catch on just because its usage
> is made slightly more convenient (we're talking about a reduction of
> about 1 line of code).
Some anecdotal evidence, FWIW: reviewing some old code I
came across two places where I was initially tempted
to use meaningful -errorcodes, but then thought
"Why bother? I'm never going to look at them,
the [if {[catch { }]} { switch $::errorCode { ... } }]
idiom is utterly unperspicuous," so I didn't.
Had a nice try/onerror construct been available,
I would have. So I don't think the hypothesis
is entirely without merit :-) Sure, it's only
a reduction of about 1 line of code, but that 1
line is *ugly* code.
--Joe English
jen...@fl...
|