[plt-scheme] for-each - analagous to map

From: Jos Koot (jos.koot at telefonica.net)
Date: Mon Feb 16 04:46:11 EST 2009

yes
jos

----- Original Message ----- 
From: "wooks" <wookiz at hotmail.com>
To: <plt-scheme at list.cs.brown.edu>
Sent: Monday, February 16, 2009 7:15 AM
Subject: [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.
> 
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.