Chapter #1 Examples in Oz
%%%%%%%%%%%%%%%%%%% Chapter - 1 %%%%%%%%%%%%%%%%%%%%%%
% 1.1
{Browse 1#{IsNumber 5}}
% 1.2
{Browse 2#{IsInt 5}}
% 1.3
{Browse 3#{IsInt 17}}
% 1.4
{Browse 4#{IsInt ~23}}
% 1.5
{Browse 5#{IsInt 5.32}}
% 1.7
{Browse 4#{IsInt 13}}
% 1.8
{Browse 8#{IsBool true}}
% 1.9
{Browse 9#{IsBool true}}
% 1.17
{Browse 17#salt}
% 1.18
{Browse 18#pepper}
% 1.21
%% datatype num = zero | one_more_than of num
% 1.22
{Browse 22#zero}
% 1.23
{Browse 23#one_more_than(zero)}
% 1.25
{Browse 25#one_more_than(one_more_than(zero))}
% 1.27
{Browse 27#one_more_than(
one_more_than(
one_more_than(
one_more_than(zero))))}
% 1.33
{Browse 33#bread(0)}
% 1.34
{Browse 34#bread(true)}
% 1.45
{Browse 45#bread(one_more_than(zero))}
% 1.46
{Browse 46#bread(bread(0))}
% 1.47
{Browse 4#bread(bread(one_more_than(zero)))}
|