Re: Future Objective-C changes
Re: Future Objective-C changes
- Subject: Re: Future Objective-C changes
- From: Jeff <email@hidden>
- Date: Fri, 16 May 2003 02:23:13 -0600
Dennis C.De Mars had what seems the most elegant addition to the
*syntax* of Obj-C in the "ObjC Wish List" thread, here:
http://cocoa.mamasam.com/MACOSXDEV/2003/03/2/59873.php
I like that it's not a language change, but a helpful syntax tweek for
NSArray, NSDictionary and NSNumber, a la NSString. This would be much
more enjoyable to code than the current syntax (which I find myself
writing over and over in different places -- this example code taken
from the above post).
[thisRecord addInfo:
@{
@"Name" => @"John Doe",
@"Age" => @(34),
@"Hobbies" => @{@"Fishing", @"Bowling", @"Philately" },
@"Children" => @{
@{@"Name" => @"Manny", @"Age" => @(6)},
@{@"Name" => @"Moe", @"Age" => @(5)},
@{@"Name" => @"Jack", @"Age" => @(4)}
}
}];
Heck it might even encourage me to use NSNumber more often.
Perhaps Perl, etc, spoiled me. I love Obj-C, but tweeks like this would
help.
Is there a way to pull this off with a compiler directive of my own
(semi-easily)?
-Jeff
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.