[Top][All Lists]

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

Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++)

From: Markus Grabert
Subject: Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++)
Date: Tue, 20 Nov 2001 14:25:19 +0000 (GMT)

On Tue, 20 Nov 2001, [utf-8] Bj??rn Gohla wrote:

> Hash: SHA1
> On Monday 19 November 2001 23:45, Ovidiu Predescu wrote:
> >
> > 1. Exception handling. I'm thinking specifically of something along
> > the lines of the Java exception handling, with its very useful
> > "finally" block. We need to consider how this would fit into the
> > current OpenStep/Cocoa exception handling, and also how it integrates
> > with the C++ model. From an implementation point of view, we can
> > probably reuse the current exception handling infrastructure from C++.

Mhh, what about NSException (NS_DURING, NS_HANDLER and NS_ENDHANDLER) ?
Moreover David Stes explains in http://users.pandora.be/stes/block98.html
how to use blocks for error handling (okay, you have to get used to it).

> > 2. Class variables. A "must add" in my opinion, as the current way of
> > defining them using static variables is far from being acceptable.


> > 3. Blocks, as described by Brad Cox.

... and implemented in POC (http://users.pandora.be/stes/compiler.html).
would a be very nice feature!

> > 4. Syntactic sugars for constant property objects.
> >
> > Of course, the new features we add to the language should not impact
> > the existing programs, which should continue to compile and run
> > correctly.

see below, last question.

> > Any other thoughts on other useful things?
> 5. how about operators?

No, operators are the worst thing ever invented!
It makes code more complicated and using operators makes debugging nearly
impossible! KISS. You'd say that it may make your code more readable.
But I'd then say: you're bad coder.

If you REALLY want to use operators, you can use them in ObjC++.
But please odn't introduce this bullshit in plain ObjC!

> 6. a mechanism to transparently access c types as objects (very handy if you
> want to store them in a container)

I'd like to say "another must have"!
Very useful indeed, but it is rather an OpenStep thing than ObjC/ObjC++.
I never understood why there is a @"" operator in ObjC.

If there is a way to introduce a general way of defining constant
objects and converting c types into (untyped id) objects (not NSString,
NSDictionary, NSArray ..., but rather a union struct) - THAT would be

reply via email to

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