I'm not clear about the semantics of the Objective-C exception- handling constructs, even after going through the Apple Objective-C documentation and the developer-doc conceptual "Exception Handling". The definitions are very terse or missing and the examples are incomplete. The problem with learning by example is that one has to make hypotheses about general cases which is dangerous.

In particular, the examples show a series of @catch blocks arranged in most-specific to least-specific order. Since the different blocks in the example have different parameter specifications for the different blocks this seems to imply that there is some sort of filtering of which block to invoke on an exception. It seems more likely to me that each successive block must inspect the exception and if it does not apply, ignore it, allowing the next @catch block to inspect and handle it. However, the examples do not show this, and nothing is written to indicate how to let the next block be invoked to inspect and handle or ignore it. Again, I presume that this is accomplished by doing nothing and falling off the end of the block. I don't like this as an assumption, since this is an exception (no pun intended) to the normal semantics - i.e., falling off the end of a procedure or method is equivalent to an implicit "return". I'm not arguing against the syntax/ semantics here - I would just like to be sure about the semantics. Does falling off the end of a @catch block invoke the next @catch block ( or the @finally if there are no more @catch blocks)?

The section on "Exception Handling With Macros" indicates the alternatives for leaving the exception domain, but no such table exists in the "Handling Exceptions Using Compiler Directives" It does indicate that "return" or "goto" may be used, but not "setjmp or longjmp". The semantics of "goto" seem problematic. I would assume that one could "goto" a label in the @try block, but a "goto" to a label in another "catch" block could be disastrous. My C manuals say that it is illegal to "goto" out of the current function.

t appears (another assumption) that a "return" will exit the current method.

Can anyone clear me up on this?

Regards,

Dale Miller
[EMAIL PROTECTED]



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to