[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Finalized Exceptions
- From: Michael Roth <mroth@...>
- Date: Sat, 07 Aug 2004 02:04:03 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
only an idea: What about something like this:
~ function try(body_function, exception_handler)
~ ...
~ end
~ function foobar(...)
~ local socket = nil
~ try { function()
~ -- some code that raises an error
~ socket = socket_open(...)
~ socket_send(socket, ...)
~ socket_read(socket, ...)
~ end;
~ function()
~ -- called when an error was raised
~ if socket then
~ socket_close(socket)
~ end
~ end }
~ end
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBFBxzSIrOxc3jOmoRApQnAKCywYikA8XjHfzS1mwJKbDc3och1ACgkqyG
vF1DaWl2iEkHaS66y65NjSQ=
=Ht8F
-----END PGP SIGNATURE-----