RosettaCodeData/Task/Nested-function/Maple/nested-function.maple

20 lines
303 B
Plaintext

makelist:=proc()
local makeitem,i;
i:=1;
makeitem:=proc(i)
if i=1 then
printf("%a\n", "1. first");
elif i=2 then
printf("%a\n","2. second");
elif i=3 then
printf("%a\n", "3. third");
else
return NULL;
end if;
end proc;
while i<4 do
makeitem(i);
i:=i+1;
end do;
end proc;