• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: functions as sort of first class objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: functions as sort of first class objects


  • Subject: Re: functions as sort of first class objects
  • From: Christopher Stone <email@hidden>
  • Date: Tue, 24 May 2016 00:13:10 -0500

On May 23, 2016, at 23:20, Mitchell L Model <email@hidden> wrote:
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?
______________________________________________________________________

Hey Mitchell,

h() does not exist.

h does.  It is not a handler but a reference to a handler.

You also need to reference a() & b() properly:

----------------------------------
to a()
  display alert "A"
end a

to b()
  display alert "B"
end b

repeat with h in {my a(), my b()}
  h
end repeat
----------------------------------

--
Best Regards,
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

  • Follow-Ups:
    • Re: functions as sort of first class objects
      • From: Deivy Petrescu <email@hidden>
References: 
 >functions as sort of first class objects (From: Mitchell L Model <email@hidden>)

  • Prev by Date: functions as sort of first class objects
  • Next by Date: Re: Script to Open Camera RAW File Doesn't Open File, Gives No Error
  • Previous by thread: functions as sort of first class objects
  • Next by thread: Re: functions as sort of first class objects
  • Index(es):
    • Date
    • Thread