On Aug 16, 2013, at 22:51 , Ken Thomases <k...@codeweavers.com> wrote:

> Dot syntax is just syntactic sugar for accessing properties through the 
> accessors.

I agree with everything you said in your reply, except for a quibble about this 
one sentence.

Dot notation is *not* syntactically equivalent to method notation, not in all 
cases. Specifically, for dot notation to be syntactically legal, the class of 
the object to the left of the dot must have a visible declaration of the 
property name to the right of the dot (using either of the 2 ways of declaring 
properties).

Method notation is additionally legal when the receiver is of type 'id' and the 
named method is declared in any class that's visible at that point in the 
compilation.

Another way of saying this is that method notation can represent full 
polymorphism, but dot notation cannot.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to