From: Andy Wingo <wingo@pobox.com>
To: "Eric J. Van der Velden" <ericjvandervelden@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: map, for-each
Date: Sat, 28 Aug 2010 12:35:20 -0700 [thread overview]
Message-ID: <m3hbie34zr.fsf@unquote.localdomain> (raw)
In-Reply-To: <AANLkTikbYun8q09DNr4QVc_tm3TZKOqDznpvtmr3xtKu@mail.gmail.com> (Eric J. Van der Velden's message of "Thu, 26 Aug 2010 13:17:38 +0200")
On Thu 26 Aug 2010 04:17, "Eric J. Van der Velden" <ericjvandervelden@gmail.com> 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/
prev parent reply other threads:[~2010-08-28 19:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-26 11:17 map, for-each Eric J. Van der Velden
2010-08-26 12:16 ` Paul Emsley
2010-08-26 12:19 ` Thien-Thi Nguyen
2010-08-28 19:35 ` Andy Wingo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3hbie34zr.fsf@unquote.localdomain \
--to=wingo@pobox.com \
--cc=ericjvandervelden@gmail.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).