Higher-order functions: Difference between revisions

Line 249:
end filtered
 
-- An ordinary AppleScript handler function
 
-- lifted into a script which is a first-class object
-- Inject a handler function into a script
-- to obtain a first class object with a call method
-- (a -> b) -> Script object
on mReturn(f)
script mf
onproperty call() : f
end call
end script
set mf's call to f
return mf
end mReturn
 
 
-- HANDLER FUNCTIONS TO BE PASSED AS ARGUMENTS
9,659

edits