Nested function: Difference between revisions
Content deleted Content added
added swift |
algol 68 sample added |
||
Line 12: | Line 12: | ||
2. second |
2. second |
||
3. third |
3. third |
||
=={{header|ALGOL 68}}== |
|||
{{works with|ALGOL 68G|Any - tested with release 2.8.3.win32}} |
|||
<lang algol68>PROC make list = ( STRING separator )STRING: |
|||
BEGIN |
|||
INT counter := 0; |
|||
PROC make item = ( STRING item )STRING: |
|||
BEGIN |
|||
counter +:= 1; |
|||
whole( counter, 0 ) + separator + item + REPR 10 |
|||
END; # make item # |
|||
make item( "first" ) + make item( "second" ) + make item( "third" ) |
|||
END; # make list # |
|||
print( ( make list( "." ) ) ) |
|||
</lang> |
|||
=={{header|C#}}== |
=={{header|C#}}== |