[plt-scheme] for-each - analagous to map
Travelling salesman. So I have a tour that is list of numbers each
representing cities (0 11 3 7)
I need to get each journey 0 - 11, 11 - 3, 3 - 7 etc
I do this
(map (lambda (cities shifted-copy) ....) cities (append (cdr cities)
(list (car cities)))
getting (0 11 3 7) and (11 3 7 0) as my inputs to map.
So now the car of each list (recursively) constitutes my trip
Ok that was just motivation. I want to do this for side effects.
Does for-each share maps ability to traverse multiple lists in this
way.