Re: Automatic parameter coercions when calling
Re: Automatic parameter coercions when calling
- Subject: Re: Automatic parameter coercions when calling
- From: Shane Stanley <email@hidden>
- Date: Thu, 30 Dec 2010 13:09:08 +1100
- Thread-topic: Automatic parameter coercions when calling
On 30/12/10 12:44 PM, "Dave" <email@hidden> wrote:
> Any corrections or additions would be appreciated.
NSRect et al can be produced from records as well as lists. Other AS
classes, such as dates, are converted to NSEventDescriptors.
>
> It would be nice to have an inverse table on how returned values can be used.
> From what I understand there are no automatic coercions but it would be nice
> to have a list of what coercions can be done to which types.
Everything seems to be returned as an object of some type. All the number
classes and types seem to be returned as NSNumbers, which you can coerce to
integer or real, depending on what they were originally. NSStrings coerce to
text, NSArrays to lists, NSDictionaries to records, and NSRange et al to
records. Booleans can be coerced to booleans or integers.
AS classes are returned as NSEventDescriptors, which you can coerce to
whatever AS class they map to.
--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden