guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: map, for-each


From: Paul Emsley
Subject: Re: map, for-each
Date: Thu, 26 Aug 2010 13:16:10 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

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 via email to

[Prev in Thread] Current Thread [Next in Thread]