At 1:38 PM +1000 8/30/02, Ken Williams wrote:
>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).
Right, which is why I'd call it like:
if (!do_script_thingie()) {
print $some_error_message_or_other, $@, "\n";
next;
}
Sheesh, kids these days with their newfangled exceptions, and
objects, and whatnots. I just don't know what the world's coming to.
What's next? The Polka Dot Design Pattern? :)
Anyway, I threw this together as much because Nat wanted it as
anything else. Since it's likely to languish in Maintenance Purgatory
once I'm done fiddling, you're welcome to take the thing on.
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk