[Top][All Lists]

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

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

From: Stefan Urbanek
Subject: ObjC additions (Was: Re: PROPOSAL: Objective-C++)
Date: Mon, 19 Nov 2001 22:52:57 +0100

Kim Shrier wrote:
> Ovidiu Predescu wrote:
> > I think
> > David's hate of NS*-ism is irrelevant here, as we are talking about
> > the language and the runtime system.
> >
> About a year ago, I was about 50% through adding support for protocols
> to the POC.  David Stes raised such an objection to it that I stopped
> work.  This is one of the NS*-ism's that David dislikes and it looks
> to me like it would have a direct influence on the language and the
> runtime system.
> > There are many neat things in POC that are quite
> > interesting, like blocks for example.
> I agree.  I would like to see blocks in the GNU Objective C compiler.

Me too. And, what also about literal objects like arrays or numbers?

        ConstantArray *array = @array(@"Item 1", @"Item 2");
        array = @(@"Item 1", @"Item 2");

And numbers:
        ConstantNumber *value = @value(1);
        ConstantNumber *intValue    = @1;
        ConstantNumber *doubleValue = @1.0;

And even dictionaries:
        ConstantDictionary *dict = @{@"Key" = @"Value"};

Some default classes should be used like ConstantArray, ConstantNumber, and it
should be redefined by some gcc option, like now there is
-fconstant-string-class. Then, for example, ConstantNumber can be subclass of
NSValue. Imagine, then you would be able to write:

        [dictionary setObject:@12.0 forValue:@"Size"];

Just an idea. I think, it can be userful.

What do you thing about it?

How is it difficult to have something like this? 


reply via email to

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