On Wed, Mar 20, 2013 at 1:14 AM, Christian Sperandio <christian.speran...@gmail.com> wrote: > Use exceptions for control flow makes the developer's work easier but not > the one of reader. In other terms the maintenance may become more difficult > for the reason given by John. > > And I think when exceptions are used for control flow, the original > exception meaning is forgotten: Exceptions should inform about exceptional > errors that shouldn't happen (code implementation error, network issues, > disk failure,...). It's the opposite of user data checking :)
Exceptions are escape continuations; they should (modulo things like "finally" if present) go directly to the nearest dynamically enclosing handler. The fact that they have the name "exception" is unfortunate, because it leads to purely nominal conceptions of when they should be employed (i.e., in "exceptional situations"). That may have in fact been the intention when they were introduced, but it's hard for me to see why that's relevant. Oleg Kiselyov's implementation of generators for ocaml is based on exceptions: https://github.iu.edu/sabry/PPYield/blob/master/simple_gen.ml (as I believe is the delimcc library, under the hood); it seems silly to argue that since he makes *routine* use of exceptions, his implementation is flawed. -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social life also offer numerous other occasions to consume drinks for pleasure." [Larousse, "Drink" entry] -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.