●ハンドラの中で呼び出すハンドラを指定する
以下の例は calcList というハンドラ内で Addition というハンドラを呼び出すのか、それとも Multiplication というハンドラを呼び出すのかを calcList を呼び出す側が指定しています。ハンドラ内で使う変数名 handlerName をグローバル宣言し、わたされたハンドラ名にその変数名を付けることで呼び出すことが出来ました。
global theResult, handlerName
set numList to {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
set A to calcList(Addition, numList)
set B to calcList(Multiplication, numList)
on calcList(theHandler, dataList)
set handlerName to theHandler
set theResult to item 1 of dataList
repeat with aItem in items 2 thru -1 of dataList
handlerName(aItem)
end repeat
return theResult
end calcList
on Addition(aInt)
set theResult to theResult + aInt
end Addition
on Multiplication(aInt)
set theResult to theResult * aInt
end Multiplication
get {A, B}
結果{55, 3628800}