functions as sort of first class objects
functions as sort of first class objects
- Subject: functions as sort of first class objects
- From: Mitchell L Model <email@hidden>
- Date: Tue, 24 May 2016 00:20:48 -0400
I was experimenting today and got the following confusing results:
---------------------------------------------
to a()
display alert "A"
end a
to b()
display alert "B"
end b
my a() — works, of course
set c to my b — works!
c() — calls b!! (as I was hoping it would)
repeat with h in {my a, my b}
h() — error :-(
delay 1
end repeat
---------------------------------------------
Any guesses as to why h() doesn’t work there but c() does?
I would expect both to fail or both to succeed.
I even tried changing it to “a reference to my a” (in the semi-mystical
believe that if you have a reference, it’s often good to try dereferencing it,
and vice versa), but that didn’t work either.
I want to iterate over some handlers, calling each one (for testing purposes,
in particular, in a more complicated situation than shown above).
_______________________________________________
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