Re: nil in AppleScript
Re: nil in AppleScript
- Subject: Re: nil in AppleScript
- From: Shane Stanley <email@hidden>
- Date: Fri, 04 Nov 2016 12:50:11 +1100
On 4 Nov. 2016, at 12:38 pm, Takaaki Naganoya <email@hidden> wrote:
>
> We use "missing value" as the equivalent of “nil" in AppleScriptObjC.
> But an Apple support engineer wrote me “missing value is not the equivalent of nil. Your program has a bug”.
> I wrote a lot of AppleScriptObjC programs and “missing value” works as the equivalent of “nil” (with some warning messages. it was the issue in this case!).
>
> (1) There is an another nil equivalent keyword presents which we does not know.
> (2) There is a bug in Cocoa-bridging system
> (3) Apple employs a support monkey or a broken AI
You are correct: "missing value" *is* the equivalent of "nil".
The only complication is that Objective-C doesn't allow nil in collections like arrays and dictionaries, but uses objects of the NSNull class there instead. The bridge converts these values to "missing value" as well, which can pose problems when going the other way.
Can you post a snippet of code that shows the problem? What was the bug number?
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
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