Re: Runtime Syntax Checker



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.
.



Relevant Pages

  • Re: How to monitor Firewall exceptions that the user made?
    ... netsh firewall show allowedprogram verbose = enable ... command to output all allowed programs in exception list. ... >> all exceptions made by the user. ... in cmd window will disable exceptions ...
    (microsoft.public.windowsxp.general)
  • Re: socket calls send recv error handling questions
    ... There should not be any exceptions thrown from socket calls, ... example, that after you recva command the next recv, which gets some ... The WinSock calls don't throw C++ exceptions. ... My fear is that a heavy traffic network could ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Adding record with controls bound in code
    ... Like I said, with a couple exceptions, this is the ... I can't use wizards or set data binding in the Properties window ... db after a delete command, ...
    (microsoft.public.dotnet.languages.vb)
  • CE shell
    ... Could someone please tell me why when i type "gi" command in CE Shell ... Command is working as expected but exceptions!? ... Does anybody know why THGetMods rises exceptions when ...
    (microsoft.public.windowsce.platbuilder)
  • Re: The rap against "while True:" loops
    ... when applied to programming in general. ... the C++ admonition against using exceptions for flow control ... The notion is deeply embedded in the language and it would ...
    (comp.lang.python)

Loading