Re: Try/Catch
- Posted by Spock Feb 17, 2015
- 3965 views
With try/catch I would
No, you wouldn't. If you don't understand my explanation then reread ghaberek's post.
as you just told me I'd have to do wrapping with delete_routine() which I don't believe will be such a trivial task.
You don't need to use delete_routine() ... it's optional. You can clean up with try..catch..finally without having to use delete_routine().
Conversely, you can use delete_routine() with try..catch, SSC, and even the existing regime today (crash_routine()). These are two separate things.
Ok. I think I got this right:
1 Add delete_routine() to libraries - cleanup happens automatically when atom leaves scope
Or
2 Use try/catch/finally - manually call cleanup routine
Let's say I'm too lazy to do 1 (or it'd be really awkward since my libraries usually return integers (object IDs) not pointers). So how will I know which cleanup routines to call in finally in 2?
Spock