- <program collection control>=
<list loop>
<integer loop>
<loop by recursion>
<parallel iteration>
<reverse>
<quit recursion>
Here is the collection of all the programs:
for X in [a b c] do {Inspect X} end
for I in 2..25 do {Inspect I} end
local
proc{AboveLoop Xs}
case Xs
of nil the skip
[] X|Xss then {Inspect X} {AboveLoop Xss}
end
end
in
{AboveLoop [a b c]}
end
for
X in [a b c d]
I in 1..3
do
{Inspect X#I}
end
declare URL ='http://www.ps.uni-sb.de/~niehren/Web/Vorlesungen/Oz-NL-SS01'
declare ADS_URL = URL#'/vorlesung/Functors/Version.3.2/Abstract.ozf'
declare [ADS_Module] = {Module.link [ADS_URL]}
declare NewStack = ADS_Module.newStack
declare fun{Reverse List}
Acc = {NewStack}
in
for X in List do {Acc.push X} end
{Acc.toList}
end
{Inspect {Reverse [1 2 3 4]}}
declare proc{Process N}
if N==10000
then raise 'error in Process' end
else {Process N+1}
end
end
try
{Process 0}
catch Exception then
{Browse Exception}
end