Nested function: Difference between revisions
Content deleted Content added
added php |
added scheme |
||
Line 116: | Line 116: | ||
print(makeList(". "))</lang> |
print(makeList(". "))</lang> |
||
=={{header|Scheme}}== |
|||
<lang scheme>(define (make-list separator) |
|||
(define counter 1) |
|||
(define (make-item item) |
|||
(let ((result (string-append (number->string counter) separator item "\n"))) |
|||
(set! counter (+ counter 1)) |
|||
result)) |
|||
(string-append (make-item "first") (make-item "second") (make-item "third"))) |
|||
(display (make-list ". "))</lang> |
|||
=={{header|zkl}}== |
=={{header|zkl}}== |