RosettaCodeData/Task/Nested-function/ALGOL-68/nested-function.alg
2023-07-01 13:44:08 -04:00

12 lines
409 B
Text

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( ". " ) ) )