[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: map, for-each
From: |
Andy Wingo |
Subject: |
Re: map, for-each |
Date: |
Sat, 28 Aug 2010 12:35:20 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
On Thu 26 Aug 2010 04:17, "Eric J. Van der Velden" <address@hidden> 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/