I have to make a program in Oz that will return the max integer in a list. The code that I have so far looks like this:
declare
proc {Max Xs K}
case Xs
of nil then K = 0
[] X|Xr then
local M in
if M < X then M = X end
{Max Xr K}
K = M
end
end
end
The Mozart environment will accept the code but won't return an answer. The input looks like this: {Browse {Max [1 2]}}. What am I doing wrong?