Style question: returning error values from functions

Monte Goulding monte at sweattechnologies.com
Sat Jul 12 22:12:00 EDT 2003


> I readily use throw in scripts for my own use.  I also have used it in
> a library I will make generally available, and I'm thinking of changing
> the scripts so that they do not throw.  Are people comfortable with
> throw?

Yes, I was just about to suggest it to Richard. I think this is an under
used language feature. Unfortunalty Scott designed the engine throws to
require considerable parsing of the error variable to determine the problem
so you need to handle the possibility of an engine throw. One advatage of
throws is that they continue through the heirarchy until they are handled. I
also find that scripts that use try/catch control structures are far clearer
to read.

Cheers

Monte




More information about the metacard mailing list