Re: Runtime Syntax Checker
- From: "tom.rmadilo" <tom.rmadilo@xxxxxxxxx>
- Date: Tue, 2 Dec 2008 20:48:16 -0800 (PST)
On Dec 2, 5:29 pm, Neil Madden <n...@xxxxxxxxxxxxx> wrote:
What *is* your point? How would you like Tcl to handle exceptions? Are
you advocating a total language? Would you prefer something like
Erlang's crash-only philosophy?
Hmmm, I write programs with the hope that each command succeeds, which
means that it completes without error. For some reason the Tcl manual
(and I guess those who wrote it) equate errors with other "exceptions"
like return, break and continue. I'm not sure why these are grouped
together with real exceptions, there is nothing unexpected or
exceptional when you invoke [return], [break] or [continue]. These are
distinct commands, not the result of an error in command execution.
Commands like [foreach], [while], [for] and several others prove that
it is possible to respond to a subset of "exceptions". In fact, they
respond to a known and consistent set of "exceptions", ignoring
others.
Without getting too technical, exceptions are things which are not
supposed to happen. When exceptions do occur the code which handles
the exception becomes specialized and focused on recovery. But this
specialization and focus is impossible if the code which catches the
exception is generic. [Catch] is generic. Every [catch] has to handle
everything not zero. The good news is that if the code inside your
[catch] doesn't contain [return], [break] or [continue], you only have
to deal with actual errors and your custom flow control codes.
Personally this seems like bad news to me. I would rather deal with
one consistent set of data. Error codes combined with flow control
codes is something I avoid. [Catch] is like calling 9-1-1. You do it
in an emergency, and 90% of the time you end up looking like a fool.
But! At least the fool doesn't suffer the fate of the idiot who thinks
that everything will work out and strives to not appear the fool.
.
- Follow-Ups:
- Re: Runtime Syntax Checker
- From: Neil Madden
- Re: Runtime Syntax Checker
- References:
- Re: Runtime Syntax Checker
- From: tom.rmadilo
- Re: Runtime Syntax Checker
- From: Neil Madden
- Re: Runtime Syntax Checker
- From: tom.rmadilo
- Re: Runtime Syntax Checker
- From: Neil Madden
- Re: Runtime Syntax Checker
- Prev by Date: Re: empty dict?
- Next by Date: Re: Scrollbar problem
- Previous by thread: Re: Runtime Syntax Checker
- Next by thread: Re: Runtime Syntax Checker
- Index(es):
Relevant Pages
|
Loading