Well, this is going to spark a lot of debate. Or it would on a Java
programmer's list, anyway.
The one thing you'll need to do at a minimum if you're going to use a
lot of exception throwing for non-local, non-exceptional control flow
is use the trick of overriding the "fillInStackTrace()" method to be a
no-op. This method accounts for the vast majority of the cost of
new-ing a Throwable.
> ...
>
> Thoughts, criticisms?
I've said it before and I'll say it again: I'm not paid to think.
> jim
Randall Schulz
Thanks
sRp
sRp
>
>
> On May 6, 9:09 pm, Scott Parish <s...@srparish.net> wrote:
> > Yes, sorry i meant "conditions" not "conditionals". The ability to
> > restart is nice, but what i miss more is just the ability to
> > "throw" (non-error) values out of semi-deeply nested function calls,
> > rather then having to handle return values all the way back down the
> > stack.
> >
>
> A second way is to use some data-bearing var to hold any anomalous
> values seen in the nested computation.
Ah, i think this answers my question. I can have a var that i bind the
result data to, and then throw an exception indicating successful
completion of said task, catch such exception, and retrieve the value out
of the dynamic var.
Now if it were easier to define new types of exception subclasses in
clojure. <g>
sRp