On Thu 26 Aug 2010 04:17, "Eric J. Van der Velden" 
<[email protected]> writes:

> I don't understand what the manual says about when there are more then two 
> arguments to map or for-each.
>
> With two arguments, the last one must be a list, so OK is
>
> (for-each display '(1 3))

Consider:

  (map + '(1 3))
    = (list (+ 1) (+ 3))
    = (list 1 3)
    => (1 3)

  (map + '(1 3) '(5 7))
    = (list (+ 1 5) (+ 3 7))
    = (list 6 10)
    => (6 10)

After the function, all args need to be lists. The `display' example you
gave, even if you had given for-each lists, still doesn't make sense:

  (for-each display '(1 3) '(5 7))
    = (begin (display 1 5) (display 3 7))
    => ERROR: in (display 1 5): 5 is not a port

Hope that helps,

Andy
-- 
http://wingolog.org/

Reply via email to