You just have to declare or local..end. The Max function did not give
you error, since it is an in-built function as well.
declare
fun {MaxOfThree X Y Z}
{Max X {Max Y Z}}
end
-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Roger Mason
Sent: Tuesday, April 14, 2009 10:08 AM
To: [email protected]
Subject: simple function failure (newby)
Hello,
I'm trying mozart for the first time. When I send the following to the
compiler, some work, some don't:
{Browse 'Hello World!'}
works.
fun {Max X Y}
if X>Y then X
else Y
end
end
{Browse {Max 3 5}}
works.
fun {MaxOfThree X Y Z}
{Max X {Max Y Z}}
end
Fails:
%********************* binding analysis error *******************
%**
%** variable MaxOfThree not introduced
%**
%** in file "Oz", line 11, column 5
%** ------------------ rejected (1 error)
I got the two functions from
http://www.ling.gu.se/~lager/kurser/ExploringOz/Exercises/Solutions/maxO
fThree.htm.
I have no clue what I'm doing wrong.
Thanks for any help,
Roger Mason
________________________________________________________________________
_________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users