Loop over multiple arrays simultaneously: Difference between revisions

Content added Content deleted
(→‎{{header|Scheme}}: Cleanup. Previous one could display wrong values, creates garbage, and unneded use of 'begin'.)
Line 501: Line 501:
=={{header|Scheme}}==
=={{header|Scheme}}==
<lang scheme>
<lang scheme>
(map (lambda (x y z)
(for-each (lambda (x y z)
(begin
(display x)
(display x)
(display y)
(display y)
(display z)
(newline))
(display z)
'(a b c) '(A B C) '(1 2 3))
(newline)))
'(a b c) '(A B C) '(1 2 3))
</lang>
</lang>
The R5RS standard specifies that the three lists must be of the same size.
The R5RS standard specifies that the three lists must be of the same size.