Tony Finch cites Hans Aberg, who comments the posting of Eric Zuurbier who writes that: "... Exceptions are merely a way to structure the code, so that the main line and error handling can be neatly separated." * > This is the original idea, but I pointed out that exceptions are in * > fact much deeper: They can be used as a programming technique too, * > and further, many common language constructs (such as "return", * > "break", etc in C++) can be viewed as special cases of exception * > handling. [HA] > > Indeed, in Modula-3, RETURN and EXIT are defined in terms of > exceptions. > > I like the idea of the non-deterministic exception system that has > been proposed, but it'll be interesting to see how well it works in > real life... > > Tony. I am afraid that we are repeating what has been already said, but OK, this is the essence of wisdom... I don't think that I would agree with such philosophy. "break" in C is nothing more than a structured "goto". Break from "switch" is just a jump, from a loop it might do some cleanup (if the loop index is stacked). "Return" is also a jump with the cleanup of the last instance frame. As we all know, all this can be represented by continuations, and this is a practical issue, not a statement that "all Turing machines are equal, only some are more equal than the others..." There is - in my opinion - nothing "exceptional" in *standard* imperative control structures. OK, I admit that I am a sinner myself, and I had written some small event-driven programs using (ppardonnez le mot) "longjump" in C, but I believe strongly that the functional programming community with the monadic religion etc. is much more close to the Truth. Jerzy Karczmarczuk Caen, France
Exceptions and functions. Second round?
Jerzy Karczmarczuk Tue, 16 Jun 1998 14:01:49 +0200 (MET DST)
- Re: Exceptions and functions. Second round? Jerzy Karczmarczuk
- Re: Exceptions and functions. Second round? Hans Aberg
- Re: Exceptions and functions. Second round? Greg Michaelson
- Re: Exceptions and functions. Second round? Alastair Reid
- Re: Exceptions and functions. Second round? Fergus Henderson
- Re: Exceptions and functions. Second round? Greg Michaelson
