On Friday, August 30, 2002, at 12:42 PM, Dan Sugalski wrote:
> Yech. Potentially fatal errors should be thrown only for 
> potentially fatal things. Failure to compile a script doesn't 
> strike me as a life or death kinda thing. (But, then, I'm not 
> really a 'wrap it in an eval' kind of programmer. It looks 
> nasty in perl 5. Maybe in perl 6...)

Speaking from the point of view of a "wrap it in an eval" 
programmer: the point behind exceptions is that the code itself 
can't know what's fatal and what's not fatal.  That kind of 
decision is dependent on the context.  All the code can do is 
determine whether a function/method can properly do its job.

Anyway, that's why I prefer using exceptions, and why if 
Mac::AppleScript were my code I'd probably make it die().  
Otherwise all the programs that use it are probably going to do

   compile_function() or die "Couldn't compile: $@";

anyway, and that seems poorly Huffman coded (to steal a metaphor).

  -Ken

Reply via email to