unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Paul Emsley <paul.emsley@bioch.ox.ac.uk>
To: guile-user@gnu.org
Subject: Re: map, for-each
Date: Thu, 26 Aug 2010 13:16:10 +0100	[thread overview]
Message-ID: <4C765B0A.8010608@bioch.ox.ac.uk> (raw)
In-Reply-To: <AANLkTikbYun8q09DNr4QVc_tm3TZKOqDznpvtmr3xtKu@mail.gmail.com>

On 26/08/10 12:17, Eric J. Van der Velden wrote:
> Hello,
>
> 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))
>
> But the following are ERR,
>
> (for-each display 1 3)
>
> (for-each display '(1 3) '(1 3))

The function, in this case `display', needs to be able to take 2 args, 
for display it's the variable and the port:

(for-each display '(1 3) (list (current-output-port) (current-output-port)))

also consider

(map + '(1 3) '(1 3))

Paul.






  reply	other threads:[~2010-08-26 12:16 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 [this message]
2010-08-26 12:19 ` Thien-Thi Nguyen
2010-08-28 19:35 ` Andy Wingo

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=4C765B0A.8010608@bioch.ox.ac.uk \
    --to=paul.emsley@bioch.ox.ac.uk \
    --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).