Objective-C Properties (was Re: AppleScriptObjC oddity)
Objective-C Properties (was Re: AppleScriptObjC oddity)
- Subject: Objective-C Properties (was Re: AppleScriptObjC oddity)
- From: Chris Page <email@hidden>
- Date: Sun, 12 Jul 2015 23:31:36 -0700
On Jul 12, 2015, at 10:20 PM, Shane Stanley < email@hidden> wrote:
And if you call a property as a method -- and until relatively recently they were pretty much all methods anyway -- I can't see why you would expect it to behave differently.
… …when admittedly properties were rarer in Objective-C…
To be clear: properties and "@property" declarations are independent. It used to be the case that "[foo bar]" and "foo.bar" had different semantics, but now they are essentially the same. Now that Objective-C has unified properties and accessors, every method that takes no parameters and returns a result is a property, whether or not it's declared with "@property". "@property" is merely a convenient syntax for declaring and generating accessors, and it's entirely optional when you're defining a property.
Any method that takes no parameters and returns a function is a property whose value is a function. Since blocks were introduced there are now many classes with properties (declared with "@property" or as getters) whose values are functions. For example, see NSOperation. In addition, Objective-C has always had methods for working with C functions (IMPL), and there are lots of C functions that work with C function pointers and blocks.
I think it's better if we don't spend too much time and effort arguing against or preventing future support for all Objective-C—and related C—idioms.
Please report any missing support for working with Objective-C frameworks that's important to you as a bug or enhancement request to help us prioritize future directions:
-- Chris Page The other, other AppleScript Chris
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden