[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: student question: append-map
From: |
Paul Morris |
Subject: |
Re: student question: append-map |
Date: |
Mon, 22 Jun 2015 22:30:02 -0400 |
> On Jun 22, 2015, at 7:15 PM, David Garfinkle <address@hidden> wrote:
>
> Can't seem to find any code examples of the Scheme function (append-map f
> list1 list2) online, and I can't seem to call it correctly at all. Could
> anyone show me how it works?
It seems that the function given as the first argument needs to return a list,
that way the lists it returns can be appended.
Cheers,
-Paul
#(display
(append-map
(lambda (a b) (list (+ a b)))
'(1 2 3)
'(4 5 6)))
=> (5 7 9)