RE: "Try? There is no try." -- Yoda's Exception handling syntax
[email protected] Wed, 16 Aug 2000 07:11:48 -0700
| Newsgroups | perl.perl6.language.flow,perl.perl6.announce |
|---|---|
| Message-ID | <502A5A303044D211AACB0008C7FADA9E030A8D8A@scoemail01.sconet.ca.gov> |
I do not know what advantages the try statement would have in perl. However, in Java programming it makes exception handling more explicit. It basically allows the programmer to "try" a certain action and see what the effects are going to be (i.e. handle the exception) so that some action can then be taken based on the results of the exception. If no exception happens then the code did exactly as you expected. If not, then perhaps the action was not appropriate for that peice of code. This can be useful in an OO application. - Bradley S. Behrens -----Original Message----- From: Graham Barr [mailto:[email protected]] Sent: Wednesday, August 16, 2000 3:23 AM To: David L. Nicol Cc: [email protected]; [email protected]; [email protected] Subject: Re: "Try? There is no try." -- Yoda's Exception handling syntax On Tue, Aug 15, 2000 at 08:11:55PM +0000, David L. Nicol wrote: > Would someone please enlighten me as to the purpose of an explicit "try." In my mind it allows the important code to come before the "oh crap something went wrong" code. Graham.