Nested function: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 692: | Line 692: | ||
2. second |
2. second |
||
3. third</pre> |
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}}== |
=={{header|Objective-C}}== |