[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATCH: Merge objc-improvements-branch to mainline

From: Ziemowit Laski
Subject: Re: PATCH: Merge objc-improvements-branch to mainline
Date: Wed, 24 Sep 2003 17:47:17 -0700

On Wednesday, Sep 24, 2003, at 16:55 US/Pacific, Nicolas Roard wrote:

On 2003-09-24 18:24:44 +0000 Stan Shebs <address@hidden> wrote:

This has been one of the most heavily-requested features for ObjC. While
it's true that it's syntactic sugar, so is for(), and yet few suggest
that it should be removed from C. For that matter, many programmers
contend that ObjC and C++ are unnecessary syntactic sugar too... The
rationale for adding exception handling, aside from the incessant user
requests, is that it is hard to get right manually, plus the manual
solution involves fooling around with explicit flow control in the form
of setjmp/longjmp, which you really want to hide whenever possible.

What I don't understand, is that we _already_ have an exception system,
so what was those requests about ?
If NS_DURING/NS_HANDLER names scared programmers, well, we could
define them as @try ... @catch :-)
But I don't see what's so interesting with the new exception system, apart
to bring some incompatibilities ...
Someone could explain it to me ?

See previous e-mails from Stan and myself. :-)

Which reminds me, I did forget to mention yet 2 more benefits:
- The exception system will automatically mark variables volatile as needed, so that they do not get clobbered by the _setjmp/_longjmp interaction. - If an exception is not handled by any of your @catch clauses, it is automatically propagated up the call chain

All in all, it makes exceptions in ObjC much more accessible to those coming from C++ or Java.

Ziemowit Laski                 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group        Cupertino, CA USA  95014-2083
Apple Computer, Inc.           +1.408.974.6229  Fax .5477

reply via email to

[Prev in Thread] Current Thread [Next in Thread]