% $Id: TupleError2.oz,v 1.1 2007/11/27 03:02:22 leavens Exp leavens $ % This file is intended to demonstrate what % Mozart error message "type error" with a complaint from Tuple.make % that it expected a literal means. % It may be useful for you to feed it to Oz % and see what exact messages are generated, % so you can learn to read such messages. declare fun {Add3 X} X + 3 end % The next two lines are to confuse Mozart's static analysis. declare MaybeLabel in MaybeLabel = if {Add3 4} < 8 then Add3 else normalLabel end % The following is fine, as MaybeLabel is really a function {Browse {MaybeLabel 3}} % The following generates a "type error", since MaybeLabel is not a label {Browse MaybeLabel(5)} % type error, wrong syntax for calling a function!