From: "James F.Hranicky" Date: 2002-09-18T22:51:16+09:00 Subject: Rescue clause or equivalent for catch? --=.aVmtBQp(1sKeVq Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Does having a rescue clause for catch sound like a good idea to anyone? You could write this: catch (:error) { # Do stuff do_stuff() # throws :error do_more_stuff() # throws :error finish_stuff() # throws :error rescue # Oops, stuff failed, clean it cleanup_stuff() end do_junk_whether_stuff_failed_or_not() instead of this catch(:done) { catch (:error) { # Do stuff do_stuff() # throws :error do_more_stuff() # throws :error finish_stuff() # throws :error throw :done } # Oops, error, clean up cleanup_stuff() } do_junk_whether_stuff_failed_or_not() Just wondering. ---------------------------------------------------------------------- | Jim Hranicky, Senior SysAdmin UF/CISE Department | | E314D CSE Building Phone (352) 392-1499 | | jfh@cise.ufl.edu http://www.cise.ufl.edu/~jfh | ---------------------------------------------------------------------- "Given a choice between a complex, difficult-to-understand, disconcerting explanation and a simplistic, comforting one, many prefer simplistic comfort if it's remotely plausible, especially if it involves blaming someone else for their problems." -- Bob Lewis, _Infoworld_ --=.aVmtBQp(1sKeVq Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (SunOS) iD8DBQE9iITJqJn1asfI5oQRAiE8AJ4y3uBMHsFCO4KeGJyRGI45G52BygCfZEfw lrR/36gGMQxHJ3av0wIuCmg= =kiVA -----END PGP SIGNATURE----- --=.aVmtBQp(1sKeVq--