Re: Why is a-b not equal to ((source of a) -b) ?
Re: Why is a-b not equal to ((source of a) -b) ?
- Subject: Re: Why is a-b not equal to ((source of a) -b) ?
- From: email@hidden
- Date: Wed, 4 Sep 2002 10:53:57 -0400
On Tue, 3 Sep 2002 22:56:36 -0700, From: bill fancher <email@hidden>
responded,
>
It's not so *quite* so clear cut. E.g. this (in a tell app "Hypercard"
>
block):
>
>
tell stack "FPDirectory" to close
>
>
generates
>
>
core\clos{ ----:obj { form:'name', want:'cSTK', seld:"FPDirectory",
>
from:'null'() }, &subj:obj { form:'name', want:'cSTK',
>
seld:"FPDirectory", from:'null'() }, &csig:65536 }
>
>
Notice that the stack has slipped from being the "target" of the tell
>
to being the direct object of event (AND the "subject").
I think this is an example of AppleScript being more object-oriented than
AppleEvents. A stack can't receive an AppleEvent, only an application. But why
both the subject and the direct object? I guess its more robust to translate
the AppleScript into an AppleEvent like 'tell stack "FPDirectory" to close stack
"FPDirectory"'
>
I had originally (wrongly) thought something similar might be happening
>
here and thought I'd clearly acknowledged that I was not correct in
>
thinking that: "I thought... but testing reveals...".
I also found myself totally unable to make a clear point on this matter. I
thought I had this all down cold, since I've been using named parameters in
script objects, and ran into object vs. target confusions. But now I recall it
just never was clear, and ended up never using a direct object as a script
object's handler. It confused me and made the English-like syntax less
grammatic.
>
I don't think we really disagree on anything here, though I do seem to
>
have expressed myself poorly. Apologies for that.
I didn't mean to take exception, either. I think you got everything right, but
I got mislead by the deep level of quoting. I think we'll all agree this is a
fair synopsis:
1. "Direct object" has a higher precedence than subtraction. So,
osaxCommand - 5
parses as osaxCommand( -5 ), and not as (osaxCommand()) - 5
2. Implicit "get", "of", and multiple context-dependent meanings for "of"
(property, handler, application object, direct object of handler) can make
things that look alike do different things.
3. As we've often observed here, "English like syntax" means that if you want,
you can write AppleScript that reads like English. It does not mean that if you
write something that reads like English, it will do what you want.
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.