Nested function: Difference between revisions

no edit summary
No edit summary
Line 692:
2. second
3. third</pre>
 
=={{header|Maple}}==
<lang Maple>
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;
 
</lang>
 
=={{header|Objective-C}}==
Anonymous user