-- The following function MyMax takes a function LessThan as parameter,
-- and returns the maximum of X and Y w.r.t. the ordering defined by the
-- function LessThan.
Define MyMax(LessThan, X, Y)
If Call(LessThan, X, Y) Then Return Y Else Return X EndIf
EndDefine;
-- Let's use MyMax by giving two different orderings.
Define LT_Standard(X, Y)
Return X < Y;
EndDefine;
Define LT_First(X, Y)
Return TRUE;
EndDefine;
MyMax(Function("LT_Standard"),3,5);
5
-------------------------------
MyMax(Function("LT_First"),5,3);
3
-------------------------------
MyMax(Function("LT_First"),3,5);
5
-------------------------------
MyMax(Function("LT_First"),5,3);
3
-------------------------------
|