[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++)
From: |
Dan Pascu |
Subject: |
Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++) |
Date: |
Tue, 20 Nov 2001 15:45:59 +0200 (EET) |
On 20 Nov, Pascal Bourguignon wrote:
>> array = @(@"Item 1", @"Item 2");
>
> I don't see the difference with:
>
> NSArray* array=[NSArray arrayWithObjects:@"Item 1",@"Item 2",0];
>
>> or
>> ConstantNumber *intValue = @1;
>> ConstantNumber *doubleValue = @1.0;
>
> or with:
>
> NSNumber* intValue=[NSNumber numberWithInteger:1];
> NSNumber* doubleValue=[NSNumber numberWithDouble:1.0];
>
>> And even dictionaries:
>> ConstantDictionary *dict = @{@"Key" = @"Value"};
>
> or with:
>
> NSDictionary* dict=[NSDictionary dictionaryWithObjectsAndKeys:
> @"Key1",@"Value1",
> @"Key2",@"Value2",
> 0];
Less typing maybe? Your examples are twice as long (even longer).
Also more compact syntax? Easier to use too?
> You could even add some macros such as:
>
> #define BD [NSDictionary dictionaryWithObjectsAndKeys:
> #define ED ,0]
>
> to be able to write:
>
> ConstantDictionary* dict = BD @"Key", @"Value" ED;
Eeek. That's UGLY. I wouldn't do that even in plain C.
>> What do you thing about it?
>
> I don't think it's needed.
You can live without indeed, but it would be nice to have.
--
Dan
- Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++), (continued)
- Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++), Björn Gohla, 2001/11/19
- Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++), Bjoern Giesler, 2001/11/20
- Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++), Björn Gohla, 2001/11/20
- Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++), Philippe C.D. Robert, 2001/11/20
- Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++), Philippe C.D. Robert, 2001/11/20
- Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++), Markus Grabert, 2001/11/20
- Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++), Markus Grabert, 2001/11/20
- Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++), Pascal Bourguignon, 2001/11/19
- Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++),
Dan Pascu <=
- Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++), Balazs Pataki, 2001/11/20
- Re: PROPOSAL: Objective-C++, Stan Shebs, 2001/11/19
- Re: PROPOSAL: Objective-C++, Ovidiu Predescu, 2001/11/19
Re: PROPOSAL: Objective-C++, dewar, 2001/11/19
RE: PROPOSAL: Objective-C++, Bissell, Tim, 2001/11/20