[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-devel
Subject:    Re: student question: append-map
From:       Paul Morris <paul () paulwmorris ! com>
Date:       2015-06-23 2:30:02
Message-ID: BF7E3F14-1DC9-499D-92BA-EA2365183E2A () paulwmorris ! com
[Download RAW message or body]

> On Jun 22, 2015, at 7:15 PM, David Garfinkle <david.etan.garfinkle@gmail.com> \
> 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)


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic