News for hackers. Stuff that matters.
Re:Objective-C literals for NSDictionary, NSArray, and NSNumber by __david__ on Sunday February 19, 2012 @06:00PM (#3610684)
Because presumably (I don't have the new XCode to check) you can do things like:

    [someObject dictArg:@{ a:@"B" } arrayArg:@[1,2,34]];
So if they were both using "{" to set them off the parser doesn't know which one you mean until it hits the first ":" (and it can't guess from the type when the type is "id"). Now that's not impossible to write a parser that looks ahead to figure out what you mean, but it's much easier to parse if they have completely different syntax from the outset. And the "{" vs "[" distinction is very standard amongst the higher level languages, even if it isn't in straight C.

There are no comments on this comment yet.